Open tvvignesh opened 3 years ago
Okay, this is tricky. Adding federation types manually would make VSCode GraphQL extension work, but codegen fail since both use the same graphql-config
For eg. if I have the schema like this:
schema:
- "http://g.lvh.me:2500/graphql"
- "./packages/modules/**/schema/**/*.gql"
(I have also added the apollo federation spec to my gql files in the wildcard)
VSCode extension will work but graphql-codegen
will fail since I already have federation: true
set there and it anyways generates all federation types for me. So, manually defining or overriding it myself are causing errors. So, there needs to be a way like what codegen offers with federation: true
in this extension as well I guess to offer proper GQL Federation support.
Any update on this? I think it would be great to support custom directives, so other platforms also work. I'm having problems with Fauna, and I already noticed many issues concerning Apollo/Relay
Has any work begun on this?
Any update on this? At least can we ignore error, and support possible one?
Actual Behavior
If I have a schema which have Apollo Federation specific directives like
@key
and@external
the extension fails with the error:Expected Behavior
Having apollo federation support would be great. When using the graphql-config yaml, I anyway specify that the schema is federated using the config as per this doc: https://graphql-code-generator.com/docs/integrations/federation
So, the extension can probably use a similar config to infer the same and allow use of such directives.
Steps to Reproduce the Problem Or Description
Try adding a Apollo Federation schema with relevant directives and the extension fails with errors.
Specifications
Logs Of TS Server || GraphQL Language Service
UPDATE:
I have managed to get it working for now manually declaring the Federation directives (had to comment out
_entities
though since it didn't work.