Comments (5)
I finally found the reason of the bug. I am using a monorepo and there were conflicts between versions of GraphQl (16.8 and 15.8). In graphQl-tools, there was a deprecation with the field isPossibleType which led to an invalid schema. The fix was to upgrade graphql at the root of the monorepo and it worked
from graphql.
Many thanks for raising this bug report @TheMaximeBatandeoExperience. 🐛 We will now attempt to reproduce the bug based on the steps you have provided.
Please ensure that you've provided the necessary information for a minimal reproduction, including but not limited to:
- Type definitions
- Resolvers
- Query and/or Mutation (or multiple) needed to reproduce
If you have a support agreement with Neo4j, please link this GitHub issue to a new or existing Zendesk ticket.
Thanks again! 🙏
from graphql.
Hi @TheMaximeBatandeoExperience, I can't reproduce this issue locally. Are you able to provide a full code-example which reproduces this issue?
from graphql.
Yes, thank you for your quick answer
import {getNeo4JSession} from "./neo4j";
import {Neo4jGraphQL} from "@neo4j/graphql";
export const neoSchema = async () => {
try {
const {driver} = await getNeo4JSession();
const schema = new Neo4jGraphQL({
typeDefs: `#graphql
type Movie {
title: String
actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN)
}
type Actor {
name: String
movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT)
}
`,
driver
});
const yogaSchema = await schema.getSchema();
return yogaSchema;
} catch (error) {
console.error("Error initializing schema", error);
}
};
I use it a nextJs 14 AppRouter. So i created a route api/graph/route.ts where my yoga server lives using the implementation in the yoga documentation
import { createSchema, createYoga } from 'graphql-yoga'
const { handleRequest } = createYoga({
schema: await neoSchema()
}
}),
// While using Next.js file convention for routing, we need to configure Yoga to use the correct endpoint
graphqlEndpoint: '/api/graphql',
// Yoga needs to know how to create a valid Next response
fetchAPI: { Response }
})
export { handleRequest as GET, handleRequest as POST, handleRequest as OPTIONS }
Also I tried with apollo server and same trouble.
I am not sure that it is relevant but from the beginning I always had a Typescript error with the schema provided by Neo4jGraphQl (with Apollo or Yoga)
Unable to assign 'GraphQLSchema | undefined' au type 'YogaSchemaDefinition<{}, {}> | undefined Missing isPossibleType
from graphql.
Hi @TheMaximeBatandeoExperience
Sorry, but the code you provided doesn't seem correct as it is invalid javascript (maybe a copy paste problem?).
Please refer to this example on how to set up a yoga server with Neo4j GraphQL (you can ignore the typedefs and the subscription on that example), I just checked that example and the js code should work.
For how to integrate yoga with NextJS you'll need to refer to either one of those projects.
from graphql.
Related Issues (20)
- Subscriptions don't support update_relationship
- Field with populatedBy directive should appears in UpdateInput or CreateInput when not defined in the operations HOT 8
- Cannot deactivate the top-level queries for unions HOT 10
- Export the Neo4jGraphQLError classes
- Add "filtering" and "sorting" support to fields that rely on custom resolvers HOT 1
- Relationship is settable via update mutation, but settable directive is set to false. HOT 9
- Wrong cypher generated for nodes with multiple labels HOT 2
- `Neo4jError: Invalid input 'WHERE': expected` when using auth in specific scenarios HOT 3
- Argument "phrase" is blocked for custom cypher queries since Neo4j-GraphQL >5 HOT 2
- Querying an interface produces very slow query with a lot of UNION HOT 3
- Neo4jError: Variable not defined caused by authorization filters HOT 4
- Model.find({where: {id}}) returns wrong output. HOT 6
- Regression on ID scalar type filtering HOT 8
- Neo4jError: Variable `<propertyName>Count` not defined HOT 5
- Error "Cannot return null for non-nullable field" when limit exceeds result count in queries with non-nullable fields HOT 2
- Authorization rules can't compare enum property with context HOT 3
- Compatibility of @neo4j/graphql with neo4j-driver HOT 14
- GraphQL parsing issue with `[[String!]]!` HOT 2
- Filtering issue in `@authorization` directive HOT 2
- Nested mutation with deep connect inside a create is failing with the error- Neo4jError: Variable `this` already declared HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graphql.