Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for repeatable directives #351

Closed
maraisr opened this issue Jul 13, 2020 · 11 comments
Closed

Add support for repeatable directives #351

maraisr opened this issue Jul 13, 2020 · 11 comments
Labels
Milestone

Comments

@maraisr
Copy link
Contributor

maraisr commented Jul 13, 2020

Describe the bug
symbols not defined in the correct order, seem to say they're not defined.

ie;

interface Node @source(...) { }

directive @source(...) repeatable on ENUM | OBJECT | INTERFACE | UNION | INPUT_OBJECT | FIELD_DEFINITION | INPUT_FIELD_DEFINITION | ARGUMENT_DEFINITION | ENUM_VALUE

Doesn't like that source isn't defined—and yet it is.

Which leads me into a second issue;

It doesn't like the repeatable keyword used.

To Reproduce

  1. make the above your schema
  2. look at errors

Expected behavior
Be happy

Version and Environment Details
Operation system: Windows10
IDE name and version: WebStorm 2020.1.3
Plugin version: 2.5.0

Additional context

Seems to not like anything defined after it had been used

@jimkyndemeyer
Copy link
Collaborator

Hi Marais,

Thanks for using the plugin.

This appears to relate to graphql/graphql-spec#472

In essence this means that the grammar for the plugin and also graphql-java needs to be extended.

https://github.com/jimkyndemeyer/js-graphql-intellij-plugin/blob/d83dad8bc30b528b6cc9928408ea7e77df6b16bb/src/grammars/GraphQLParser.bnf#L317

graphql-java:
https://github.com/graphql-java/graphql-java/blob/bb87d8f5211f4770934bbca408ca41557d5b4196/src/main/antlr/GraphqlSDL.g4#L124

The reason it's marking @source as being undefined is simply due to the directive definition not following the expected grammar, and therefore not being picked up.

There is a bit of work in this because it cuts across grammar + completion in the plugin, and grammar + schema validation in graphql-java.

@jimkyndemeyer jimkyndemeyer changed the title Doesnt parse schema properly Add support for repeatable directives Jul 13, 2020
@vepanimas
Copy link
Collaborator

A related issue in graphql-java/graphql-java#1763.

@lorado
Copy link

lorado commented Jan 10, 2021

First - thank you for amazing plugin!
Do you have any updates? graphql-java seems to have implemented support for repeatable

@vepanimas
Copy link
Collaborator

@lorado hi, I remember about it and plan to implement it during this month.

@asolopovas
Copy link

Hi guys thanks for the plugin, any updates on this issue?

@vepanimas
Copy link
Collaborator

@asolopovas hi! I'm working on it right now and plan to fix it this month.

@stayallive
Copy link

@vepanimas much appreciated 👌

@maraisr maraisr closed this as completed Mar 27, 2021
@stayallive
Copy link

@maraisr Why was this closed?

AFAIK this is not yet implemented so it would be good to keep this issue open so it can be closed once it is available to prevent people opening up issues to re-request this feature 👍

@vepanimas
Copy link
Collaborator

@stayallive @maraisr actually I'm working on it right now. I'm preparing a v3 update in a separate branch https://github.com/jimkyndemeyer/js-graphql-intellij-plugin/tree/v3, where the process of working with a schema is completely reworked, which will help resolve a lot of issues, especially in scenarios when the schema is split between different files. Also, I'm implementing all the missing parts in the spec: descriptions for schema definitions, extend schema definitions and repeatable directives. We plan to start testing it this week and release ASAP.

@vepanimas vepanimas reopened this Mar 29, 2021
@stayallive
Copy link

@vepanimas no worries you already said it was coming and I'm assuming that comment was missed by some 👍

Again many thanks for your work 💪

vepanimas added a commit that referenced this issue Mar 30, 2021
@vepanimas vepanimas added this to the 3.0 milestone Apr 24, 2021
@spawnia
Copy link

spawnia commented Aug 2, 2021

Working perfectly as of version 3.0, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants