js-graphql-intellij-plugin
js-graphql-intellij-plugin copied to clipboard
Provide built-in type definitions for Apollo framework
Describe the bug Getting the above error, which was unexpected since the Release Notes state: Fixed displaying Apollo @client fields as errors.
To Reproduce https://github.com:raarts/graphql-plugin-error (See DarkMode.tsx)
Expected behavior No error.
Version and Environment Details Operation system: MacOS 11.5.2 Big Sur IDE name and version: WebStorm 2021.2.1 Build #WS-212.5080.54 Plugin version: 3.0.0 (fresh install)
Additional context Only using local fields so far.
Hi! You can define a client directive somewhere in the .graphql file in your project (or in the schema file specified in your .graphqlconfig) like directive @client on FIELD
and it will work. We don't provide directives for frameworks except for Relay and built-in ones yet, framework detection and providing type definitions are in the roadmap.
If we talk about what is written in the release notes, it was meant that the presence of such a directive prevents marking a corresponding field as unresolved (before / after on the screenshot).
This is how it looks when a directive is defined:
Works. Thanks!
Great! I'll reopen it to track any further progress on that.