ardatan / graphql-toolkit

A set of utils for faster development of GraphQL tools

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

type instanceof GraphQLObject type is not safe

wtrocki opened this issue · comments

Checking if(type instanceof GraphQLObject) type is not safe when having multiple packages.

Implementation should use isGraphQLType helpers from graphql schema as they are checking if the types are coming from the same package.

With multiple package structure, it will be possible that type will be created from different graphql-js instance - this will lead to graphql-toolkit failing silently - while using helpers triggers helpfull message for users to fix graphql duplicate in node modules. This is very simple fix but wanted to know opinion before PR.

This is minor issue

Available in latest version!