Graphql: читать директиву SDL из типа - PullRequest
0 голосов
/ 09 июня 2018

Я пытаюсь получить директивы от типа.

Часть схемы:

directive @translates(
    type: String
) on OBJECT | FIELD_DEFINITION


type DocumentTranslated @translates(type: Document) {
...
}

Схема чтения:

info.schema.getTypeMap()['DocumentTranslated'].astNode

Результат:

{ kind: 'ObjectTypeDefinition',
  description: undefined,
  name:
   { kind: 'Name',
     value: 'DocumentTranslated',
     loc: { start: 8893, end: 8911 } },
  interfaces: [],
  directives: [],
  fields:

Не понимаю, почему директивы отсутствуют в AST?Как я могу прочитать директивы типа?

...