Skip to content

afreakk/n4j-issue

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Example of neo4j/graphql issue

Run tests by executing following commands:

yarn install
./test.sh watch-test

Test should now fail with:

...snipped...
-               "id": Any<String>,
+           "extensions": Object {
+             "code": "INTERNAL_SERVER_ERROR",
+             "stacktrace": Array [
+               "Neo4jGraphQLForbiddenError: Forbidden",
...snipped...

Now if you change the following type in schema.graphql:

type VehicleCard
    @authorization(
        validate: [{ where: { node: { tenant: { admins: { userId: "$jwt.id" } } } } }]
    ) {
    id: ID! @id
    garages: [Garage!]! @relationship(type: "VALID_GARAGES", direction: OUT)
    tenant: Tenant! @relationship(type: "VEHICLECARD_OWNER", direction: OUT) # <---  this line
}

By move the pointed to line up so the type will look like this:

type VehicleCard
    @authorization(
        validate: [{ where: { node: { tenant: { admins: { userId: "$jwt.id" } } } } }]
    ) {
    id: ID! @id
    tenant: Tenant! @relationship(type: "VEHICLECARD_OWNER", direction: OUT) # <---  this line
    garages: [Garage!]! @relationship(type: "VALID_GARAGES", direction: OUT)
}

Tests will now pass... (you can force save index.test.js to force rerun of tests)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published