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
0
votes
0 answers

React Unique Keys requirement

I'm running through the starterapp in the GrandStack.IO Grandstack repo Everything comes up and renders, but I'm getting the warning: Warning: Each child in a list should have a unique "key" prop. Check the render method of `RecentReviews`. in…
LarryBud
  • 990
  • 9
  • 20
0
votes
1 answer

GraphQL & Neo4j : how to modify a property with a mutation request?

I have article nodes in a Neo4j database. One of his property is a boolean: "saved: false". The property name of this node is "saved". I have a React interface where I want users to be able to save articles as favorites. So what I would like to do…
jos97
  • 405
  • 6
  • 18
0
votes
0 answers

how to enable detailed errors from useQuery Apollo hook - graphql

I've an Apollo fullstack application generated with GRANDstack template, and a i've added a query that is probably wrong! I got this error: Response not successful: Received status code 400 So, i've tried to add errorPolicy: 'all to useQuery…
pinale
  • 2,060
  • 6
  • 38
  • 72
0
votes
1 answer

How to return several results in a only one GraphQL request?

I have a GRANDstack app. For this app I have a Cypher request in Neo4j like this: MATCH (c:CLUSTER) WITH c ORDER BY c.cluster_score DESC LIMIT 5 MATCH (c)<-[:HAS_CLUSTER]-(a:ARTICLE) WITH c,a ORDER BY a.article_score DESC RETURN c, collect(a)[..5]…
jos97
  • 405
  • 6
  • 18
0
votes
0 answers

SET a property during a custom cypher query

Is something like this advisable? GetConversationsByMember(userId: ID!): [Conversation] @cypher( statement: """ MATCH (u:User {id: $userId})-[:IN_CONVERSATION]->(c:Conversation)-[:NEWEST_MESSAGE]->(newestMessage) …
Matt Larsuma
  • 1,456
  • 4
  • 20
  • 52
0
votes
1 answer

Neo4j/Cypher optionally create a Node and relationship based on whether a JSON object is empty or not

First off, I am using the GRANDstack with Flutter as my frontend. Not super relevant, but for context. I have a CreatePost mutation: mutation CreatePost(\$body: String!, \$userId: ID!, \$imageReference: CreateImageReference!, \$mentions: [String!])…
Matt Larsuma
  • 1,456
  • 4
  • 20
  • 52
0
votes
1 answer

What are the best practices for GRANDstack installation in Azure?

I have to start a GRANDstack (GrapQL, React, Apollo, Neo4j Database) projet from scratch in Azure. I know that for Neo4j Database I can install a Virtual Machine on Azure. But for GraphQL, React and Apollo I don't know what are the best pratices to…
LJRB
  • 199
  • 2
  • 11
0
votes
1 answer

Dynamic search bar with a variable in a GraphQL query

I have the following query working well back-end side: { fuzzyArticleByTitle(searchString:"tiktok"){ title } } The result is several article title matching with "tiktok" string. I would like to code a dynamic search bar in front-end side…
LJRB
  • 199
  • 2
  • 11
0
votes
1 answer

Custom resolve function returned undefined in grandstack

I have type definitions for A and B defined in the schema.graphql file. Resolvers for these are auto-generated and work well (in other places). To create a scoring mechanism that ranks nodes with label B in relation to the node with label A, I am…
manonthemat
  • 6,101
  • 1
  • 24
  • 49
0
votes
1 answer

Setting up user level authorization in GRANDstack

I created a question-answer platform (similar to stackoverflow) based on the GRANDstack using authorization using the repo graphql-auth-directives. This allows us to check on authentication, authorization on role level or scope level. In this…
N Meibergen
  • 362
  • 2
  • 14
0
votes
1 answer

Error: Do not know how to handle this type of mutation. Mutation does not follow naming convention

Using the GRANDstack Starter template project, I'm using apollo-server in combination with neo4j. I have a CreateParticipant mutation (defined in the schema.graphql with a @cypher directive) that I want to reuse for a new mutation. The simplified…
manonthemat
  • 6,101
  • 1
  • 24
  • 49
0
votes
2 answers

Auto-generated Mutation Does Not Create Relationship

I want to test auto-generated CRUD mutations created by calling makeAugmentedSchema from 'neo4j-graphql-js'. There is no problem with creating nodes but creating relationship does not work for me. Please advise on what I am doing wrong…
antdro
  • 31
  • 4
0
votes
1 answer

Material UI card rendering Issues with dynamic data from GraphQL

I'm having issues with the Card rendering using Material UI in a GRANDstack application I'm building. When I set the cards up with static data they render as expected: const getMemsCard = (memID) => { return ( <>
Sean
  • 494
  • 6
  • 23
0
votes
1 answer

how to import a local js package instead of a network package

I want to customize the default apollo-server that is included in grand-stack-starter to do this, I cloned apollo-server and replaced it (in grand-stack-starter) import { ApolloServer } from "apollo-server-express"; for import { ApolloServer } from…
a1oleg
  • 73
  • 7
0
votes
1 answer

Define direction for type @relation with from and to for the same type

Is it possible to define directions for a type @relation with from and to for the same type in neo4j-graphql? Type Relation @relation(name: "RELATION") { from: Node! to: Node! property: Int! } Type Node { id: ID! in: [Relation] out:…
mattorp
  • 31
  • 6