Questions tagged [grandstack]

GRANDstack is combining GraphQL, React, Apollo, and the Neo4j Database into a modern stack for fast application development. You can find documentation, releases, and starters at https://grandstack.io. Before asking please make sure you use the latest release, no one else asked the question and you provided your GraphQL schema, - query, JS code and log outputs from GraphQL and Neo4j.

GRANDstack is combining GraphQL, React, Apollo, and the Neo4j Database into a modern stack for fast application development.

You can find documentation, blog, releases, and starter projects at https://grandstack.io.

Before asking please make sure you use the latest release, no one else asked the question and you provided your GraphQL schema, - query, JS code and log outputs from GraphQL and Neo4j.

The GRANDstack uses a query transpiler driven by the GraphQL schema (IDL, SDL) to generate Cypher queries for your GraphQL queries to run against Neo4j. Unlike most other GraphQL implementations, no n+1 backend queries are needed. A single Cypher query can serve arbitrarily complex GraphQL.

It works by augmenting your schema, adding additional top-level queries for your types. Also, mutations to create, update and delete types and relationships are added automatically. You control some of that with custom directives like @relationship.

Additionally, computed queries, mutations and fields can be added by providing Cypher statements in @cypher directives for them.

Here is an example schema:

type Movie {
    title: String
    year: Int
    imdbRating: Float
    genres: [Genre] @relation(name: "IN_GENRE", direction: "OUT")
}
type Genre {
    name: String
    movies: [Movie] @relation(name: "IN_GENRE", direction: "IN")
}
55 questions
1
vote
0 answers

Calling auto-generated queries and mutations with neo4j-graphql-js

After a suggestion from another question I had, with version 1.0.2 of neo4j-graphql-js, relationships are supported now with the auto-generated schemas. What I had been doing up to this point, due to a kind of complex form was import my graphql…
BehemothDan
  • 316
  • 3
  • 15
0
votes
1 answer

Neo4j Returns Results @apollo/server does not

I can see the generated query in my vscode terminal with debugging turned on: DEBUG=@neo4j/graphql:* node index2.js @neo4j/graphql:execute About to execute Cypher: Cypher: MATCH (this:`Business`) RETURN this { .name } AS this Params: {} +45ms …
0
votes
0 answers

How to build a graph on crud operations using neo4j graphql library?

I was trying to build grandstack app using neo4j graphql library. Rather than working on already existing data, like the most tutorials shown in the internet for neo4j. I want to build a graph by asking the user data using a react form. As I am new…
0
votes
1 answer

Setting up REST-API on top of GraphQL-API (using apollo gateway?)

I am working on a GRANDstack (GraphQL-React-Apollo-Neo4jDatabase) project and got told that it now needs an additional REST-API without making huge changes to the existing backend and GraphQL-API. And of course we have to be quick about it. We found…
0
votes
1 answer

unknown directive "@isAuthenticated". Using Neo4j and Graphql

I'm trying to do something like this : const neoSchema = new Neo4jGraphQL({ typeDefs, driver, resolvers, config: { jwt: { secret: process.env.JWT_SECRET || 'secret', }, database: process.env.NEO4J_DATABASE || 'neo4j', …
Jimmy Soussan
  • 652
  • 3
  • 14
0
votes
1 answer

How to add a unique constraint on type field with Graphql and Neo4j?

I'm making a GRANDStack application so I'm using neo4j and graphql, I have this type in my schema.graphql file : type User { userId: ID! username: String! @unique mail: String! @unique password: String! @private } But I'm still able to…
Jimmy Soussan
  • 652
  • 3
  • 14
0
votes
1 answer

How to query relationships of neo4j with custom query with cypher using Grandstack?

I have these models : type User { userId: ID! mail: String! password: String! @private meals: [Meal!] @relationship(type: "IN_MEALS", direction: OUT) } type Meal { name: String! createdBy: User! @relationship(type: "IN_MEALS",…
Jimmy Soussan
  • 652
  • 3
  • 14
0
votes
0 answers

Relationship IN and OUT not working as expected with cypher in graphql/neo4j

I'm having an issue creating a relationship the right way, I have these schemas : type User { id: ID! mail: String! password: String! @private meals: [Meal] @relationship(type: "IN_MEALS", direction: IN) } type Meal { name: String! …
Jimmy Soussan
  • 652
  • 3
  • 14
0
votes
1 answer

Substitute for @additionalLabels in Neo4j GraphQL 2.0

We run a project that uses the @additionalLabels directive to create multi-tenancy like it is suggested by the older version of the GRANDstack documentation. Now we run into the problem when migration to the new version that this directive is "Not…
0
votes
1 answer

new Neo4jGraphQL({ typeDefs, driver }) causes Unknown directive error

I am trying to create a new GRANDstack application. The database already exists, so I've used the "infer-schema.js" script, to generate the gql schema. When I run the api server, I get the following error: Error: Unknown directive…
Chris Wohlert
  • 610
  • 3
  • 12
0
votes
1 answer

Unhandled Rejection (Error): Rendered more hooks than during the previous render (React Interface GrandStack with ApolloClient)

I have an error that always occurs when I refresh my page (on localhost) I use the GrandStack React Interface based on a Neo4J database and I wanted to create a table with data filters. I used the code found right here (the complete code on…
abirb
  • 1
  • 1
0
votes
1 answer

Field-level cypher statements do not work when accepting parameters in Apollo-server

The cypher directive on a field-level does not work as expected. Minimal example: type Question { id: ID! @id required: Boolean testing(someId: ID!): Boolean @cypher(statement: """ MATCH (q:Question {id:$someId}) RETURN q.required …
manonthemat
  • 6,101
  • 1
  • 24
  • 49
0
votes
1 answer

Error: Type with name "Long" does not exists

I am doing a code along project of GRAND stack real-estate-app "https://www.youtube.com/watch?v=WB--CkjKJMQ&list=PL9Hl4pk2FsvUjfSsxLolVToO5t1hwEIKK&index=2" I have installed all the dependencies and configured the database v3.5.18 and set the…
Chinmay Dali
  • 375
  • 5
  • 14
0
votes
1 answer

Setting up Relationship types in GrandStack

I am trying to setup a relationship type in Grandstack. I am having issues getting things to run correctly. Even when I copy the guide into my project and try to run it ... things do not work. Here is what they have at…
0
votes
1 answer

grandstack add mutation with relationship

i'm able to call a mutation in order to insert a node, but what if i want to insert the relationship with another node as well? I saw that the grandstack has generated some mutations of this type: AddGroupUsers How can i call this mutation togeder…
pinale
  • 2,060
  • 6
  • 38
  • 72