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

Response for graphiQL does not work correctly #13

Open
Stanislav-Lapata opened this issue Jan 19, 2018 · 2 comments
Open

Response for graphiQL does not work correctly #13

Stanislav-Lapata opened this issue Jan 19, 2018 · 2 comments

Comments

@Stanislav-Lapata
Copy link
Contributor

Stanislav-Lapata commented Jan 19, 2018

I use https://github.com/skevy/graphiql-app
request with params

query IntrospectionQuery {
  __schema {
    queryType {
      name
    }
    mutationType {
      name
    }
    subscriptionType {
      name
    }
    types {
      ...FullType
    }
    directives {
      name
      description
      locations
      args {
        ...InputValue
      }
    }
  }
}

fragment FullType on __Type {
  ...
}

fragment InputValue on __InputValue {
  ...
}

fragment TypeRef on __Type {
  ...
}

return

{"data":{"__schema":{...}, "errors":[{"message":"field not defined.","path":["__schema","subscriptionType"]}]}

Should be without the "errors" key or with the "errors" key but without the "__schema" key
See please here and here
Validate struct should be before execution code in app
also method max_depth should ignore this request

Sorry for my English

@ziprandom
Copy link
Owner

ok, it seems the graphql spec changed. I was used to the field that's having an error being returned as nil. Having the app check the query before execution would add to execution time but might be a good idea anyways.

I'm not sure if ignoring max_depth for the __schema request is a good idea as it opens up the system forattacks if the schema has circular associations like address having a user and user having an address. In this case a query with a fragment might lead to endless loops.

I will look into that as soon as I find the time. Feel free to add a pull request if you need this fast...

@Stanislav-Lapata
Copy link
Contributor Author

Maybe then put a default value of 20-50?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants