在graphql server

时间:2018-04-01 19:14:18

标签: graphql graphql-js express-graphql graphql-tools

如何实现支持以下内容的架构: http://graphql.org/learn/queries/#directives

当我在参数之前使用$时,我得到一个解析错误

GraphQLError: Syntax Error: Expected Name, found $

"
/Users/pradipeyoggi/Apps/zestygrid/node_modules/graphql/language/parser.js:1299
  throw (0, _error.syntaxError)(lexer.source, token.start, 'Expected ' + kind + ', found ' + (0, _lexer.getTokenDesc)(token));
  ^
GraphQLError: Syntax Error: Expected Name, found $
    at syntaxError (/Users/pradipeyoggi/Apps/zestygrid/node_modules/graphql/error/syntaxError.js:24:10)
    at expect (/Users/pradipeyoggi/Apps/zestygrid/node_modules/graphql/language/parser.js:1299:32)
    at parseName (/Users/pradipeyoggi/Apps/zestygrid/node_modules/graphql/language/parser.js:92:15)
    at parseInputValueDef (/Users/pradipeyoggi/Apps/zestygrid/node_modules/graphql/language/parser.js:842:14)
"

我已经尝试过直接的graphql.js和graphql-tools。当我的架构中有$时,我得到两个错误。我错过了什么?

如果有一个参考实现或可用的示例如何实现指令(不是自定义指令,只有标准的@include @include或@var @skip),这将有所帮助。

0 个答案:

没有答案