Skip to content
New issue

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

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

Already on GitHub? # to your account

Unexpected Name "directive" #88

Closed
atsao-godaddy opened this issue Nov 16, 2021 · 9 comments
Closed

Unexpected Name "directive" #88

atsao-godaddy opened this issue Nov 16, 2021 · 9 comments

Comments

@atsao-godaddy
Copy link

Error caused by directive in graphql schema file

directive @authorized on FIELD_DEFINITION
@Yamashou
Copy link
Owner

Yamashou commented Nov 22, 2021

Please tell me the schema of your server. I also want to check

@atsao-godaddy
Copy link
Author

directive @authorized on FIELD_DEFINITION

directive @goModel(model: String, models: [String!]) on OBJECT
    | INPUT_OBJECT
    | SCALAR
    | ENUM
    | INTERFACE
    | UNION

directive @goField(forceResolver: Boolean, name: String) on INPUT_FIELD_DEFINITION
    | FIELD_DEFINITION

type Group {
  id: ID!
}

input NewGroup {
  name: String!
}

type Mutation {
  createGroup(input: NewGroup!): Group! @authorized
}

@Vitaly1025
Copy link

same problem with "extend"
clientgen failed: : : ./editions/mutations.graphql:1: Unexpected Name "extend"

@mobiletoly
Copy link
Contributor

any plans to fix this issue? generating code from schema file becomes useless, because it fails if we use custom directives.

@glebsts
Copy link

glebsts commented Nov 23, 2022

still broken - we also use custom directives. @Yamashou are you ready for review&merge fix PR with minimal functionality of skipping any directive keywords?

@Yamashou
Copy link
Owner

@glebsts I have not been able to replicate this case.
It would be helpful to have a repository with a minimum configuration that can reproduce this case

@glebsts
Copy link

glebsts commented Nov 24, 2022

Problem seems to be in vektah/gqlparser. I'll go to its github..

@sonatard
Copy link
Collaborator

sonatard commented Dec 31, 2023

#193 may fix this issue. Please try https://github.com/Yamashou/gqlgenc/releases/tag/v0.16.1

@Sonovrik
Copy link

Sonovrik commented Jun 4, 2024

Same problem on forceResolver directive

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

No branches or pull requests

7 participants