graphql-type-json icon indicating copy to clipboard operation
graphql-type-json copied to clipboard

What's the purpose of specifiedByUrl ?

Open joonhocho opened this issue 5 years ago • 7 comments

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?

joonhocho avatar Jun 26 '20 07:06 joonhocho

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?

taion avatar Jun 26 '20 11:06 taion

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).

joonhocho avatar Jun 27 '20 09:06 joonhocho

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.

taion avatar Jul 01 '20 01:07 taion

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

GraphQLSchemaValidationError: Unknown directive "specifiedBy"

xinghul avatar Aug 29 '20 22:08 xinghul

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

tot-ra avatar Sep 15 '20 07:09 tot-ra

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".

jisack avatar Aug 03 '21 08:08 jisack

The @specifiedBy also breaks autocomplete functionality in Postman

geoffoliver avatar Mar 28 '22 02:03 geoffoliver