js-graphql-intellij-plugin icon indicating copy to clipboard operation
js-graphql-intellij-plugin copied to clipboard

Provide built-in type definitions for Apollo framework

Open raarts opened this issue 2 years ago • 3 comments

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.

raarts avatar Sep 04 '21 13:09 raarts

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). apollo-client-fields

This is how it looks when a directive is defined: apollo-client-ok

vepanimas avatar Sep 05 '21 01:09 vepanimas

Works. Thanks!

raarts avatar Sep 05 '21 21:09 raarts

Great! I'll reopen it to track any further progress on that.

vepanimas avatar Sep 06 '21 01:09 vepanimas