Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid TypeError when querystring is present, but query missing #964

Merged
merged 5 commits into from
Apr 18, 2018

Commits on Apr 13, 2018

  1. Avoid TypeError when querystring is present, but query missing

    The express-graphql reference implementation [provides a check]
    (https://github.com/graphql/express-graphql/blob/2e27a7335875f23ae5cccc97a9d6926970fb08c3/src/index.js#L201-L208)
    to protect against cases where a GET request is made that does not
    have a `query` parameter where the GraphQL query would be present.
    
    Without this guard, graphql-js's `parse` will return `undefined`
    for the `DocumentNode` since it has no document to read. Subsequently
    passing this to `isQueryOperation` results in a `TypeError`, because
    we are providing `undefined` where `getOperationAst` [expects to get
    a DocumentNode](https://github.com/graphql/graphql-js/blob/5fe39262a308df944a87cc85b225228e7556aaa4/src/utilities/getOperationAST.js#L19).
    
    A new test file is added for `runHttpQuery`, as one previously did
    not seem to exist.
    steverice committed Apr 13, 2018
    Configuration menu
    Copy the full SHA
    7ad44d1 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b9db269 View commit details
    Browse the repository at this point in the history

Commits on Apr 16, 2018

  1. Configuration menu
    Copy the full SHA
    d5ff2cb View commit details
    Browse the repository at this point in the history

Commits on Apr 17, 2018

  1. Configuration menu
    Copy the full SHA
    6ee6bf3 View commit details
    Browse the repository at this point in the history

Commits on Apr 18, 2018

  1. Configuration menu
    Copy the full SHA
    c96cfe7 View commit details
    Browse the repository at this point in the history