Skip to content

Typescript error when creating scalar type #1958

Closed
@joeytepp

Description

@joeytepp

When creating a GraphQLScalarType in my schema I am getting a typescript error. Here is a simplified example of my code.

export default {
  MyScalar: new GraphQLScalarType({
    ...
    parseLiteral(ast) {
      return ast.value;
    }
  })
}

The error message is

Property 'value' does not exist on type 'VariableNode | IntValueNode | FloatValueNode | BooleanValueNode | NullValueNode | EnumValueNode | ListValueNode | ObjectValueNode'

Any help is appreciated!

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