-
Notifications
You must be signed in to change notification settings - Fork 22
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
Introspection schema returns empty values for input types #4
Comments
Hey @danielvladco! Thanks for opening this. I think this issue belongs in the nautilus/graphql package. I'll move it over there for you. I have some time to investigate this today so hopefully I'll have something for you soon |
Okay so I've tried to see if I can reproduce your problem and I think I need a bit more information. I ran the following code in a script and was able to find the fields for an input type:
Is the payload you posted above a response from introspecting the gateway? Or is that the introspection query to one of the backend services? |
Hi @AlecAivazis , run this piece of code: schemas, err := graphql.IntrospectRemoteSchemas(
"https://api.graphql.jobs/",
)
if err != nil {
panic(err)
}
, _ := json.Marshal(schemas[0].Schema.Types["TagWhereInput"])
fmt.Printf("%s/n", string(b)) notice how You can introspect the endpoint directly and see all the mismatching fields. |
Ah yea I noticed a similar inconsistency today while digging through this. I'll try to have a fix for you very soon. Sorry about this! |
Okay i just pushed a fix that assigns the right Looking at the introspection query used in the gateway (the same used by most libraries) we only ask for |
@danielvladco are you still seeing issues? |
@AlecAivazis Unfortunately yes, I use Insomnia as my graphql client and when it's trying to do introspection query I receive this error: however when I use direct link It works fine |
Okay that’s progress! Looks like insomnia is expecting a directive to be defined that isn’t. I’ll go download it and give it a try |
Alright I think we're in business now. I was able to reproduce your issue in |
Thanks, It seems to work now You forgot a print here https://github.com/nautilus/graphql/blob/master/introspection.go#L196 |
Whoops! Thanks for catching that. It should be gone now 😄 |
@danielvladco @AlecAivazis |
main.go:
gql schema:
gql query:
"Introspection Query"
expected result:
The complete json representation of gql scheam
got:
all Input types are like this.
The text was updated successfully, but these errors were encountered: