Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

buildGraphbackAPI errors with custom directives #2301

Open
alexrhogue opened this issue Aug 24, 2021 · 1 comment
Open

buildGraphbackAPI errors with custom directives #2301

alexrhogue opened this issue Aug 24, 2021 · 1 comment
Labels
question Further information is requested

Comments

@alexrhogue
Copy link

alexrhogue commented Aug 24, 2021

Hey all. We started talking about this issue over on discord:
https://discord.com/channels/632220458137419776/632220563540017153/879799832452161587

I attempted to add and use a custom directive in my data modal schema as part of a query:

directive @withCustom on FIELD_DEFINITION 

type Response {
  custom: String @withCustom
}

type Query {
  getCustom: Response
}

The schema and graphback code were generated correctly. But at runtime buildGraphbackAPI is throwing the following error:

app    | /usr/src/app/node_modules/graphql/error/syntaxError.js:15
app    |   return new _GraphQLError.GraphQLError("Syntax Error: ".concat(description), undefined, source, [position]);
app    |          ^
app    | GraphQLError: Syntax Error: Expected Name, found Int "0".
app    |     at syntaxError (/usr/src/app/node_modules/graphql/error/syntaxError.js:15:10)
app    |     at Parser.expectToken (/usr/src/app/node_modules/graphql/language/parser.js:1423:40)
app    |     at Parser.parseName (/usr/src/app/node_modules/graphql/language/parser.js:92:22)
app    |     at Parser.parseDirective (/usr/src/app/node_modules/graphql/language/parser.js:619:18)
app    |     at Parser.parseDirectives (/usr/src/app/node_modules/graphql/language/parser.js:604:28)
app    |     at Parser.parseFieldDefinition (/usr/src/app/node_modules/graphql/language/parser.js:873:27)
app    |     at Parser.optionalMany (/usr/src/app/node_modules/graphql/language/parser.js:1516:28)
app    |     at Parser.parseFieldsDefinition (/usr/src/app/node_modules/graphql/language/parser.js:858:17)
app    |     at Parser.parseObjectTypeDefinition (/usr/src/app/node_modules/graphql/language/parser.js:806:23)
app    |     at Parser.parseTypeSystemDefinition (/usr/src/app/node_modules/graphql/language/parser.js:702:23)

I'm using:

  • "graphback": "1.1.0",
  • "graphql": "15.3.0"
  • "apollo-server-express": "2.25.1"

Any help or advice would be appreciated. Thanks!

@alexrhogue alexrhogue added the question Further information is requested label Aug 24, 2021
@alexrhogue alexrhogue changed the title buidlGraphbackAPI errors with custom directives buildGraphbackAPI errors with custom directives Aug 24, 2021
@alexrhogue
Copy link
Author

Simple example repo:
https://github.com/alexrhogue/directive-detective

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant