Skip to content

0.13-rc.1 notice for maintainers who build tools around graphql-js  #1221

@nodkz

Description

@nodkz

If your tool uses AST type checks something like:

import { LIST_TYPE, NON_NULL_TYPE, DOCUMENT, NAMED_TYPE } from 'graphql/language/kinds';

...
if (inputTypeAST.kind === LIST_TYPE) { ...

You need to change your code in following manner:

- import { LIST_TYPE, NON_NULL_TYPE, DOCUMENT, NAMED_TYPE } from 'graphql/language/kinds';
+ import { Kind } from 'graphql';

...
- if (inputTypeAST.kind === LIST_TYPE) { ...
+ if (inputTypeAST.kind === Kind.LIST_TYPE) { ...

According to last improvements for v0.13.0 by @IvanGoncharov you not able to import desired AST types directly from graphql/language/kinds.

And if you want that your tool must support new and old versions of graphql lib, please use code above.

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