Comments (3)
@chaymag could you try again now with the updated version? I've updated the version of neo4j-graphql.js used which should include support for custom scalars.
Also, we're working on adding proper DateTime support to neo4j-graphql.js soon, so once this is merged in a custom scalar won't be needed and will work out of the box with the Neo4j temporal types.
from grand-stack-starter.
I've updated neo4j-graphql-js to ^1.0.5 and I'm still having the same issue @chaymag originally reported while attempting to use the DateTime custom scalar within the okgrow/graphql-scalars package , as well as the issues I've outlined in issue #15.
from grand-stack-starter.
This is due to the starter using makeAugmenentedSchema() where the install instructions for DateTime are using makeExecutableSchema.
After spending more time on this than I care to admit, I have it working. Here is my index.js
import { ApolloServer, makeExecutableSchema } from "apollo-server";
import { v1 as neo4j } from "neo4j-driver";
import { makeAugmentedSchema, augmentTypeDefs } from "neo4j-graphql-js";
import dotenv from "dotenv";
import { DateTime, DateTimeScalar} from "@okgrow/graphql-scalars"
// set environment variables from ../.env
dotenv.config();
/*
* Create an executable GraphQL schema object from GraphQL type definitions
* including autogenerated queries and mutations.
* Optionally a config object can be included to specify which types to include
* in generated queries and/or mutations. Read more in the docs:
* https://grandstack.io/docs/neo4j-graphql-js-api.html#makeaugmentedschemaoptions-graphqlschema
*/
const schema = makeExecutableSchema({
typeDefs: [
DateTimeScalar, augmentTypeDefs(typeDefs)
],
resolverValidationOptions: {
requireResolversForResolveType: false
},
resolvers: {
DateTime,
},
});
const augmentedSchema = makeAugmentedSchema({
schema: schema,
//typeDefs: typeDefs
});
/*
* Create a Neo4j driver instance to connect to the database
* using credentials specified as environment variables
* with fallback to defaults
*/
const driver = neo4j.driver(
process.env.NEO4J_URI || "bolt://localhost:7687",
neo4j.auth.basic(
process.env.NEO4J_USER || "neo4j",
process.env.NEO4J_PASSWORD || "neo4j"
)
);
/*
* Create a new ApolloServer instance, serving the GraphQL schema
* created using makeAugmentedSchema above and injecting the Neo4j driver
* instance into the context object so it is available in the
* generated resolvers to connect to the database.
*/
const server = new ApolloServer({
context: { driver },
schema: augmentedSchema
});
server.listen(process.env.GRAPHQL_LISTEN_PORT, "0.0.0.0").then(({ url }) => {
console.log(`GraphQL API ready at ${url}`);
});
from grand-stack-starter.
Related Issues (20)
- Neo4j Community Edition GCP does not come with APOC installed HOT 1
- inferschema not able to create all relations
- Error seeding HOT 2
- Auth Directives not working in api netlify function
- Eslint version issue when running create-grandstack-app using react-ts HOT 1
- Error running npx create-grandstack-app related to failed "Creating scripts configuration..." HOT 1
- Couldn't use GRANDstack Starter properly HOT 3
- Error: Cannot find module 'neo4j-driver/lib/temporal-types' HOT 1
- Authentication with Grandstack starter not working with netlify deploy @neo4j/graphql HOT 1
- yarn create not working (but npx does)
- Users List reports an Error on initial setup HOT 1
- Server responded HTTP. HOT 2
- docker-compose image does not install `graphql` HOT 2
- Docker image seems to require 4.x, but has 3.x HOT 1
- When I try to seed the database I get the error "
- Unknown Bolt protocol version 0
- Why can't I query relationships of neo4j with custom query with cypher using Grandstack?
- Is This Repo Still Being Maintained? HOT 1
- Support Vue.js
- Docker-compose build fix
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 grand-stack-starter.