relay-tools / relay-compiler-language-typescript

⛔️ Obsolete - A language plugin for Relay that adds TypeScript support, including emitting type definitions.
MIT License
240 stars 69 forks source link

Generate GraphQL fragment files for VSCode GraphQL Extension fragment autocompletion #271

Open jasonkuhrt opened 3 years ago

jasonkuhrt commented 3 years ago

Currently there is no autocomplete when spreading a fragment reference because there are no graphql fragment files to configure GraphQL VSCode extension with.

How about this relay language plugin emit them?

More context:

angel-discover commented 3 years ago

It looks like there are quite a few of these issues open:

https://github.com/relay-tools/relay-compiler-language-typescript/issues/157 https://github.com/relay-tools/relay-compiler-language-typescript/issues/205

What I did was not use the generated typescript types from relay, but instead used the types from @graphql-codegen/typescript and @graphql-codegen/typescript-operations which does generate fragment data properly.

jakobvase commented 2 years ago

The GraphQL VSCode extension supports inline fragments. I created a .graphqlrc in the root of my app with the following content, and autocompleting fragment references works.

{
  "schema": ["../backend/schema.graphql", "./src/schemaExtensions.graphql"],
  "documents": "./src/**/*.tsx"
}