Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

graphql-jit and TypeGraphQL union issues. #181

Open
reginsmol opened this issue Sep 20, 2022 · 0 comments
Open

graphql-jit and TypeGraphQL union issues. #181

reginsmol opened this issue Sep 20, 2022 · 0 comments

Comments

@reginsmol
Copy link

I'm using TypeGraphQL for defining my schema and resolvers. When enabling graphql-jit and fetching a union type I got the following error:
Abstract type Notifiable must resolve to an Object type at runtime for field Notification.notifiable. Either the Notifiable type should provide a \"resolveType\" function or each possible types should provide an \"isTypeOf\" function

It works fine without graphql-jit.

TypeGraphQL union types docs

Union type definition:

const NotifiableUnion = createUnionType({
    name: 'Notifiable',
    types: () => [A,B,] as const,
    resolveType: value => {
        if ('title' in value) {
            return A;
        }

        return B;
    },
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant