Skip to content

Commit

Permalink
fix(neo4j): use BigInt resolver only if provided in typeDefs
Browse files Browse the repository at this point in the history
  • Loading branch information
ardatan committed May 16, 2023
1 parent 0229776 commit 1705cb9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/sharp-shrimps-camp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphql-mesh/neo4j': patch
---

Do not use BigInt resolver if not provided in typeDefs
9 changes: 6 additions & 3 deletions packages/handlers/neo4j/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
YamlConfig,
} from '@graphql-mesh/types';
import { readFileOrUrl } from '@graphql-mesh/utils';
import { IResolvers } from '@graphql-tools/utils';
import { Neo4jGraphQL } from '@neo4j/graphql';
import { toGraphQLTypeDefs } from '@neo4j/introspector';

Expand Down Expand Up @@ -130,6 +131,10 @@ export default class Neo4JHandler implements MeshHandler {
const typeDefs = await this.getCachedTypeDefs(driver);

const events = getEventEmitterFromPubSub(this.pubsub);
const resolvers: IResolvers = {};
if (typeDefs.includes('scalar BigInt')) {
resolvers.BigInt = GraphQLBigInt;
}
const neo4jGraphQL = new Neo4jGraphQL({
typeDefs,
config: {
Expand All @@ -139,9 +144,7 @@ export default class Neo4JHandler implements MeshHandler {
enableDebug: !!process.env.DEBUG,
skipValidateTypeDefs: true,
},
resolvers: {
BigInt: GraphQLBigInt,
},
resolvers,
plugins: {
subscriptions: {
events,
Expand Down

0 comments on commit 1705cb9

Please sign in to comment.