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

What's the purpose of specifiedByUrl ? #275

Open
joonhocho opened this issue Jun 26, 2020 · 7 comments
Open

What's the purpose of specifiedByUrl ? #275

joonhocho opened this issue Jun 26, 2020 · 7 comments

Comments

@joonhocho
Copy link

It is a breaking change.
I am using apollo + type-graphql setup and it seems the setup is not compatible with specifiedBy directive out of the box, as it's not outputing specifedBy directive definition without touching up here and there.

What are the benefits of having the directive that it requires touching up and it also increases size of schema.graphql file?

@taion
Copy link
Owner

taion commented Jun 26, 2020

It's just better documentation.

How specifically is it breaking? It sounds like the directive is just getting ignored in your case, which doesn't seem like an issue to me?

@joonhocho
Copy link
Author

I am using apollo client to generate typescript types from schema and queries. The tool fails now with an error unknown directive "specifiedBy".
It can be patched up to work, but it still increases schema.graphql file size.
I wonder why it's necessary at all when there is description field saying the exact same thing already.
Not sure if it's worth the hassle and overhead of filesize and possible runtime performance overhead for the execution of directive (even if it's pretty much negligible).

@taion
Copy link
Owner

taion commented Jul 1, 2020

I'm not sure why the file size of the GraphQL schema matters. In general, if you're running the appropriate build steps, I don't think it should get shipped to clients.

I'm also not sure that this is a matter of this schema per se... does the spec say somewhere that it's impermissible to add these? It seems more like this is something opted into by e.g. an upgrade to graphql @ 15.x, as versions of GraphQL.js prior to this would not emit this directive.

@xinghul
Copy link

xinghul commented Aug 29, 2020

I'm also getting this error when upgraded this lib to 0.3.2:

GraphQLSchemaValidationError: Unknown directive "specifiedBy"

@tot-ra
Copy link

tot-ra commented Sep 15, 2020

+1, also getting this Unknown directive "specifiedBy" while trying to use federation. Is it possible to remove?

@jisack
Copy link

jisack commented Aug 3, 2021

I'm getting error when use apollo codegen to client side following this error 😞

Loading Apollo Project [failed]
→ Error initializing Apollo GraphQL project "Unnamed Project": Error: Error in "Loading schema for Unnamed Project": GraphQLSchemaValidationError: Unknown directive "specifiedBy".
 ›   Error: Error initializing Apollo GraphQL project "Unnamed Project": Error:
 ›    Error in "Loading schema for Unnamed Project": 
 ›   GraphQLSchemaValidationError: Unknown directive "specifiedBy".

@geoffoliver
Copy link

The @specifiedBy also breaks autocomplete functionality in Postman

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

6 participants