GraphQL - Union Types, сообщающие об ошибке, не удалось найти класс для этого имени типа - PullRequest
3 голосов
/ 17 января 2020

В моем файле схемы GraphQL я пытаюсь добавить тип объединения следующим образом:

type CoOverrides {
    coId: String
    type: String
}

type SoOverrides {
    soId: String
    freeInterval: String
}

union CoOrSoOverrides = CoOverrides | SoOverrides

Затем я назначаю это типу следующим образом:

type Campaign {
    id: ID!
    title: String
    overrides: [CoOrSoOverrides]
}

Однако на при запуске сервера graphql я получаю сообщение об ошибке:

Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.coxautodev.graphql.tools.SchemaParser]: Factory method 'schemaParser' threw exception; 
nested exception is com.coxautodev.graphql.tools.SchemaClassScannerError: 
Object type 'CoOverrides' is a member of a known union, but no class could be found for that type name.  Please pass a class for type 'CoOverrides' in the parser's dictionary.

Что это такое и как добавить этот класс в словарь анализатора?

Любая помощь приветствуется.

Спасибо.

...