Skip to content

add directives definitions to import? #201

@terion-name

Description

@terion-name

I have an app that parses schemas and is processing them.

I want to use a directive in these schemas, but not to write there it's definition (alike Prisma directives in datamodel). But I can't run import these schemas:

Error: Directive relation: Couldn't find type relation in any of the schemas.
    at collectDirective (.../node_modules/graphql-import/src/definition.ts:172:15)
    at Array.forEach (<anonymous>)
    at collectNode (.../node_modules/graphql-import/src/definition.ts:161:21)
    at .../node_modules/graphql-import/src/definition.ts:135:7
    at Array.forEach (<anonymous>)

graphql-import only works if I supply path to schema, not the schema content, so I can't simply concat directive definition during import.

So is there a way to overcome this? To add definitions during import? Or make it simply to ignore absence of relation

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions