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

Input Object fields #85

Closed
HurricaneJames opened this issue Aug 20, 2015 · 3 comments
Closed

Input Object fields #85

HurricaneJames opened this issue Aug 20, 2015 · 3 comments

Comments

@HurricaneJames
Copy link

Should input objects return a keyed set when introspecting for inputFields the way object do for fields?

Currently, the spec on introspection says that input objects have an inputFields query that returns a list. Object, on the other hand, have a fields query that returns a keyed set. Both input objects and objects take maps, even if the keys are just 0, 1, 2, 3. Is there a reason that introspection does not return a keyed set of fields for input objects? In a similar vein, why not just have the introspection query be 'fields' for both?

@leebyron
Copy link
Collaborator

Can you share the introspection query in particular? GraphQL does not have a concept of keyed sets or maps, only lists, so I'm a little confused with the issue.

inputFields and fields have different names in introspection because they return different types. Since introspection uses one simplified and flattened "__Type" type that can represent all of the types in a type system, it needs differently named fields to refer to these two different concepts.

@HurricaneJames
Copy link
Author

Apologies, I think I was confused. No, I was definitely confused. There is not a lot of literature on mutations in GraphQL, and therefore not a lot of literature on really big blobs of data in Input Objects. I was trying to tease out the implementation of GraphQL-JS vs the actual spec and Object vs Input Object.

I went back and ran the introspections again now that I have significantly more experience with Input Object, I think perhaps I was leaving out the name field, which made the two seem different. Also, defining fields on the GraphQL-JS GraphQLInputObject, but introspecting on inputFields was causing some confusion (I created a separate ticket for that issue on that project (graphql/graphql-js#144).

Sorry for wasting your time on this.

@leebyron
Copy link
Collaborator

No problem, this has been good feedback!

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