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

Question about descriptions for TypeExtensions #900

Closed
sungam3r opened this issue Nov 6, 2021 · 3 comments
Closed

Question about descriptions for TypeExtensions #900

sungam3r opened this issue Nov 6, 2021 · 3 comments

Comments

@sungam3r
Copy link
Contributor

sungam3r commented Nov 6, 2021

See http://spec.graphql.org/October2021/#sec-Type-Extensions :

Type extensions are used to represent a GraphQL type which has been extended from some original type.

So those parts of schema are server-side.

And from http://spec.graphql.org/October2021/#sec-Descriptions:

GraphQL schema and all other definitions (e.g. types, fields, arguments, etc.) which can be described should provide a Description unless they are considered self descriptive.

I see that extensions are used to extend schema definitions but they do not have descriptions. Is it done intentionally?

@benjie
Copy link
Member

benjie commented Nov 7, 2021

Type extensions don’t really “exist” once the schema is constructed so where would their descriptions go? How would you query them through GraphQL?

The only use I can think is to add or replace the description of the underlying type; but the risk there is ambiguity - what if a description is presented in both locations? Maybe it could append?

We’re currently considering adding descriptions to operations and fragments, so maybe this would make sense alongside that, but I fear it may be confusing.

What do you think?

@michaelstaib
Copy link
Member

The only use I can think is to add or replace the description of the underlying type; but the risk there is ambiguity - what if a description is presented in both locations? Maybe it could append?

Also if you have multiple extensions for a single type and every of those has a descriptions, which should you take. In the end, the extension will just add new fields or directives to the type.

If you look at the type validation rule it's also clear that nothing a type extension brings is allowed to already be on the type.

@sungam3r
Copy link
Contributor Author

sungam3r commented Nov 7, 2021

OK, thanks. I thought so.

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

3 participants