Skip to content

type issue #46

@nicolasburtey

Description

@nicolasburtey

trying to run the Value validation example.

I'm being returned this issue by typescript :

error TS2322: Type 'typeof ConcreteValidateDirectiveVisitor' is not assignable to type 'typeof SchemaDirectiveVisitor'.
  Types of property 'visitSchemaDirectives' are incompatible.
    Type '(schema: GraphQLSchema, directiveVisitors: { [directiveName: string]: typeof SchemaDirectiveVisitor; }, context?: { [key: string]: any; } | undefined) => { [directiveName: string]: SchemaDirectiveVisitor[]; }' is not assignable to type '(schema: GraphQLSchema, directiveVisitors: Record<string, typeof SchemaDirectiveVisitor>, context?: Record<string, any> | undefined, pathToDirectivesInExtensions?: string[] | undefined) => Record<...>'.
      Types of parameters 'directiveVisitors' and 'directiveVisitors' are incompatible.
        Type 'Record<string, typeof SchemaDirectiveVisitor>' is not assignable to type '{ [directiveName: string]: typeof SchemaDirectiveVisitor; }'.
          Index signatures are incompatible.
            Type 'typeof import("node_modules/@graphql-tools/utils/SchemaDirectiveVisitor").SchemaDirectiveVisitor' is not assignable to type 'typeof import("node_modules/apollo-server-core/node_modules/graphql-tools/dist/schemaVisitor").SchemaDirectiveVisitor'.
              The types returned by 'getDirectiveDeclaration(...)' are incompatible between these types.
                Type 'GraphQLDirective | null | undefined' is not assignable to type 'GraphQLDirective'.
                  Type 'undefined' is not assignable to type 'GraphQLDirective'.

adding // @ts-ignore before schemaDirectives: { range }, is silencing the issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions