# Is neo4j-graphql.js ready for production? Anyone company/persion using this in production?

**URL:** <https://community.neo4j.com/t/is-neo4j-graphql-js-ready-for-production-anyone-company-persion-using-this-in-production/6396>\
**Category:** GraphQL & GRANDstack\
**Created:** [April 6, 2019, 10:34am UTC](https://community.neo4j.com/t/is-neo4j-graphql-js-ready-for-production-anyone-company-persion-using-this-in-production/6396 "2019-04-06T10:34:22Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![shrey\_binary](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/shrey_binary/32/213_2.png) [@shrey\_binary](https://community.neo4j.com/u/shrey_binary)\
**Post date:** [April 6, 2019, 10:34am UTC](https://community.neo4j.com/t/is-neo4j-graphql-js-ready-for-production-anyone-company-persion-using-this-in-production/6396/1 "2019-04-06T10:34:22Z")

</div>

Is neo4j-graphql.js ready for production? Anyone company/persion using this in production?

@lyonwj

---

<div class="post-metadata">

**Author:** ![lyonwj](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/lyonwj/32/27358_2.png) [@lyonwj](https://community.neo4j.com/u/lyonwj)\
**Post date:** [April 6, 2019, 3:50pm UTC](https://community.neo4j.com/t/is-neo4j-graphql-js-ready-for-production-anyone-company-persion-using-this-in-production/6396/3 "2019-04-06T15:50:57Z")

</div>

In general, as a [Neo4j Labs project,](https://neo4j.com/labs/) [neo4j-graphql.js](https://grandstack.io/docs/neo4j-graphql-js.html) is being actively worked on, and might still be a bit rough around the edges. Therefore, we don't provide official commercial support for these projects or guarantee longevity. However, some Neo4j customers and users still love the functionality of these projects and choose to continue using them in production environments. Ideally, a Neo4j Labs project graduates and moves into an officially supported project at some point.

More specifically, there are still some features in neo4j-graphql.js that we need to implement, next on our list are support for filtering, better handling of union and interface types and how they relate to node labels in Neo4j, and generating type definitions from an already existing Neo4j database. So if your use case relies on these features, then it might be best to wait a bit for these to be built out.

Having said that, some companies are indeed using neo4j-graphql.js in production. For example, the Financial Times uses neo4j-graphql.js to power their "biz-ops API". Rhys Evans, Principal Engineer at the [Financial Times](https://www.ft.com/) recently gave a presentation at GraphTour London about how they leverage neo4j-graphql.js and GRANDstack, you can find the slides [here - "A field guide to the Financial Times".](https://speakerdeck.com/wheresrhys/a-field-guide-to-the-financial-times) I am aware of others using neo4j-graphql.js and [GRANDstack](https://grandstack.io/) in production, but I won't call them out here ;-)

Maybe others could chime in? Are you using [neo4j-graphql.js](https://grandstack.io/docs/neo4j-graphql-js.html) / GRANDstack in production? Tell us about it in this thread.

---

<div class="post-metadata">

**Author:** ![shrey\_binary](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/shrey_binary/32/213_2.png) [@shrey\_binary](https://community.neo4j.com/u/shrey_binary)\
**Post date:** [April 6, 2019, 7:11pm UTC](https://community.neo4j.com/t/is-neo4j-graphql-js-ready-for-production-anyone-company-persion-using-this-in-production/6396/4 "2019-04-06T19:11:04Z")

</div>

Hey @lyonwj is it updated with Apollo Server v2?

---

<div class="post-metadata">

**Author:** ![lyonwj](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/lyonwj/32/27358_2.png) [@lyonwj](https://community.neo4j.com/u/lyonwj)\
**Post date:** [April 6, 2019, 8:39pm UTC](https://community.neo4j.com/t/is-neo4j-graphql-js-ready-for-production-anyone-company-persion-using-this-in-production/6396/5 "2019-04-06T20:39:46Z")

</div>

Yup, works with Apollo Server v2 (or any other JavaScript GraphQL implementation since it is generating a GraphQLSchema object).

For an example see [neo4j-graphql-js/movies-typedefs.js at master · neo4j-graphql/neo4j-graphql-js · GitHub](https://github.com/neo4j-graphql/neo4j-graphql-js/blob/master/example/apollo-server/movies-typedefs.js)

---

<div class="post-metadata">

**Author:** ![shrey\_binary](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/shrey_binary/32/213_2.png) [@shrey\_binary](https://community.neo4j.com/u/shrey_binary)\
**Post date:** [April 7, 2019, 12:59pm UTC](https://community.neo4j.com/t/is-neo4j-graphql-js-ready-for-production-anyone-company-persion-using-this-in-production/6396/6 "2019-04-07T12:59:27Z")

</div>

Hey @lyonwj

Since, neo4j-graphql-js auto generates cypher queries based on graphql schema, how it handles the custom scalar like JSON or Date or any other scalars?

---

<div class="post-metadata">

**Author:** ![shrey\_binary](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/shrey_binary/32/213_2.png) [@shrey\_binary](https://community.neo4j.com/u/shrey_binary)\
**Post date:** [April 7, 2019, 5:54pm UTC](https://community.neo4j.com/t/is-neo4j-graphql-js-ready-for-production-anyone-company-persion-using-this-in-production/6396/7 "2019-04-07T17:54:07Z")

</div>

@lyonwj

According to Apollo GraphQL

```auto
GraphQL schemas are at their best when they are designed around the needs of client
applications. When a team is building their first GraphQL schema, they might be tempted to create
literal mappings on top of existing database collections or tables using CRUD-like root fields. While
this literal database-to-schema mapping may be a fast way to get up and running, we strongly
suggest avoiding it and instead building the schema based on how the GraphQL API will be used
by the front-end.

```

But in case of neo4j-graphql-js we have to have the same type and attribute names same as it's in database right?

---

<div class="post-metadata">

**Author:** ![lyonwj](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/lyonwj/32/27358_2.png) [@lyonwj](https://community.neo4j.com/u/lyonwj)\
**Post date:** [April 7, 2019, 6:06pm UTC](https://community.neo4j.com/t/is-neo4j-graphql-js-ready-for-production-anyone-company-persion-using-this-in-production/6396/8 "2019-04-07T18:06:21Z")

</div>

Our GraphQL integrations are intended to go the other way and drive the database model from GraphQL type definitions. So the GraphQL schema can be designed as it's intended to be used by the client and the database data model is defined from those type definitions. See [Neo4j GraphQL Library - Neo4j GraphQL Library](https://grandstack.io/docs/guide-schema.html) for the goals / principles of the Neo4j-GraphQL integrations.

Currently we don't expose any aliasing / transformation of GraphQL type def --\> database datamodel, but that's something we've considered. You could accomplish this today in a more manual way with the [`@cypher ` schema directive.](https://grandstack.io/docs/neo4j-graphql-js.html#cypher-directive)

---

<div class="post-metadata">

**Author:** ![lyonwj](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/lyonwj/32/27358_2.png) [@lyonwj](https://community.neo4j.com/u/lyonwj)\
**Post date:** [April 7, 2019, 6:08pm UTC](https://community.neo4j.com/t/is-neo4j-graphql-js-ready-for-production-anyone-company-persion-using-this-in-production/6396/9 "2019-04-07T18:08:59Z")

</div>

See [the docs here](https://grandstack.io/docs/neo4j-graphql-js.html#temporal-types-datetime) for how we handle the Neo4j temporal types in GraphQL.

For other custom types you can use [`@cypher` schema directives](https://grandstack.io/docs/neo4j-graphql-js.html#cypher-directive) to resolve these or implement custom resolvers alongside the auto-generated.

---

<div class="post-metadata">

**Author:** ![shrey\_binary](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/shrey_binary/32/213_2.png) [@shrey\_binary](https://community.neo4j.com/u/shrey_binary)\
**Post date:** [April 7, 2019, 6:09pm UTC](https://community.neo4j.com/t/is-neo4j-graphql-js-ready-for-production-anyone-company-persion-using-this-in-production/6396/10 "2019-04-07T18:09:33Z")

</div>

Or we can call the `neo4jgrapgql(obj, params, ctx, resolveInfo)` function and store the returned object into another variable then do the aliasing and then return to grpahql schema.

---

<div class="post-metadata">

**Author:** ![benjamin\_rood](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/benjamin_rood/32/5345_2.png) [@benjamin\_rood](https://community.neo4j.com/u/benjamin_rood)\
**Post date:** [June 21, 2019, 10:51am UTC](https://community.neo4j.com/t/is-neo4j-graphql-js-ready-for-production-anyone-company-persion-using-this-in-production/6396/11 "2019-06-21T10:51:17Z")

</div>

Hi William,

> Our GraphQL integrations are intended to go the other way and drive the database model from GraphQL type definitions. So the GraphQL schema can be designed as it's intended to be used by the client and the database data model is defined from those type definitions.

I applaud this approach, and it fits how our team wants to work. My frustration is that what you have said is implicitly asserted, yet it's insufficiently documented _how_ this is achieved, though. I understand that "automagic" things are very useful, I would just like to know, step by step, what is involved to achieve this?

---

<div class="post-metadata">

**Author:** ![lyonwj](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/lyonwj/32/27358_2.png) [@lyonwj](https://community.neo4j.com/u/lyonwj)\
**Post date:** [June 23, 2019, 9:24am UTC](https://community.neo4j.com/t/is-neo4j-graphql-js-ready-for-production-anyone-company-persion-using-this-in-production/6396/12 "2019-06-23T09:24:48Z")

</div>

Hi @benjamin_rood -

Have you seen the GraphQL schema design guide here: [Neo4j GraphQL Library - Neo4j GraphQL Library](https://grandstack.io/docs/guide-graphql-schema-design.html) ? This document outlines the goals of the Neo4j GraphQL integrations, how a property graph model is driven from GraphQL type definitions, what is added to the type defintions through the schema augmentation process, etc.

Exactly what kind of documentation would you like to see added that is missing? Are you asking for more about the internals of the Neo4j GraphQL integrations, and for example how they translate GraphQL to database queries?

---

<div class="post-metadata">

**Author:** ![benjamin\_rood](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/benjamin_rood/32/5345_2.png) [@benjamin\_rood](https://community.neo4j.com/u/benjamin_rood)\
**Post date:** [June 23, 2019, 11:07am UTC](https://community.neo4j.com/t/is-neo4j-graphql-js-ready-for-production-anyone-company-persion-using-this-in-production/6396/13 "2019-06-23T11:07:42Z")

</div>

Hi William,

Thanks for your reply. Yes, I've read that page, but it's too 'high-level'.

> Since GraphQL type definitions are used to define the database schema

That's great, but _where_ in the code is this done, exactly? When I create an instance by calling `neo4j.driver(...)` ?  
What side-effects occur, precisely?  
What if there is no prior database, will it automagically generate one inside the running Neo4j instance?  
Does the database schema definition persist if the GraphQL server dies?  
What if other clients need to connect directly to the Neo4j instance (via a bolt connection), can they take advantage of this schema?

I'm an engineer, I really should know how something works before I just invoke it or copy-and-paste from an example.

> Are you asking for more about the internals of the Neo4j GraphQL integrations, and for example how they translate GraphQL to database queries?

Definitely, yes, please, but just as important is documentation of `neo4j-graphql-js` as a library, i.e. `x` does this, with an example of using `x`. `y` does this... etc.

---

<div class="post-metadata">

**Author:** ![shrey\_binary](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/shrey_binary/32/213_2.png) [@shrey\_binary](https://community.neo4j.com/u/shrey_binary)\
**Post date:** [June 23, 2019, 11:23am UTC](https://community.neo4j.com/t/is-neo4j-graphql-js-ready-for-production-anyone-company-persion-using-this-in-production/6396/14 "2019-06-23T11:23:54Z")

</div>

I sure do agree with @benjamin_rood here. The documentation do need to be as detailed as possible and well structured. For instance, when I read the doc I don't exactly know what more and how @cypher directive can do for me other than the example given.

And also that's really a good question, when exactly the schema is being created in the code. I was going to ask that too. Also, I would love to contribute to this project after I get a detailed look and know how things are exactly working here.

---

<div class="post-metadata">

**Author:** ![benjamin\_rood](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/benjamin_rood/32/5345_2.png) [@benjamin\_rood](https://community.neo4j.com/u/benjamin_rood)\
**Post date:** [June 23, 2019, 4:01pm UTC](https://community.neo4j.com/t/is-neo4j-graphql-js-ready-for-production-anyone-company-persion-using-this-in-production/6396/15 "2019-06-23T16:01:13Z")

</div>

@lyonwj

I think it's necessary to have a clearly defined **spec** definition of the custom directives which `neo4j-graphql-js` supports. It _seems_ like it's just `@cypher` and `@relation`, but I'm just inferring this. I don't know it definitively because there is no explicit 'index', so to speak, of these things.

I consider this a good piece of documentaion: [https://neo4j-graphql-server.gitbook.io/docs/neo4j-graphql-server](https://neo4j-graphql-server.gitbook.io/docs/neo4j-graphql-server)  
But as it's not an official source, I have no idea whether it's out-of-date, or still valid?

This is the sort of information I need:

> The following describes the server setup process based on the default configuration:
> 
> 1. [neo4jIDL](https://neo4j-graphql-server.gitbook.io/docs/neo4j-graphql-binding/neo4jidl) is called to update your Neo4j-GraphQL schema.
> 
> 2. [neo4jAssertConstraints](https://neo4j-graphql-server.gitbook.io/docs/neo4j-graphql-binding/neo4jassertconstraints) is used to support a `@unique` directive by [creating constraints](https://neo4j.com/docs/developer-manual/current/get-started/cypher/labels-constraints-and-indexes/) in your Neo4j instance. It uses the [APOC extension](https://neo4j-contrib.github.io/neo4j-apoc-procedures/).
> 
> 3. [buildNeo4jTypeDefs](https://neo4j-graphql-server.gitbook.io/docs/neo4j-graphql-binding/buildneo4jtypedefs) then augments the same typeDefs provided to your Neo4j-GraphQL schema.
> 
> 4. [neo4jGraphQLBinding](https://neo4j-graphql-server.gitbook.io/docs/neo4j-graphql-binding/neo4jgraphqlbinding) is used to create a [custom GraphQL Binding](https://oss.prisma.io/content/GraphQL-Binding/04-Creating-your-own-Binding.html) over the resulting augmented typeDefs. The binding is added into your server's [context parameter](https://www.apollographql.com/docs/apollo-server/v2/api/apollo-server.html#constructor-options-lt-ApolloServer-gt) (default key: 'neo4j' so you can access it the way you normally would access a GraphQL Binding.
> 
> 5. [buildNeo4jResolvers](https://neo4j-graphql-server.gitbook.io/docs/neo4j-graphql-binding/buildneo4jresolvers) then generates any unprovided resolvers for query and mutation types that were generated or that use a [@cypher directive](https://github.com/neo4j-graphql/neo4j-graphql#directives). Each resolver uses a created binding to delegate all such queries and mutations to a Neo4j-GraphQL endpoint.
> 
> 6. Finally, steps 1-5 are processed for any additional binding configurations provided in `bindings` and the resulting `typeDefs` and `resolvers` are merged and provided to Apollo Server.

This states which bits are doing what. A good model is the Apollo Server docs. I'm more than happy to help contribute to this documentation, by the way.

Is support for `neo4j-graphql` (js or java implementation) covered by the Neo4j Enterprise license? Perhaps a skype call to pick your brain would be useful?

---

<div class="post-metadata">

**Author:** ![shrey\_binary](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/shrey_binary/32/213_2.png) [@shrey\_binary](https://community.neo4j.com/u/shrey_binary)\
**Post date:** [June 23, 2019, 5:31pm UTC](https://community.neo4j.com/t/is-neo4j-graphql-js-ready-for-production-anyone-company-persion-using-this-in-production/6396/16 "2019-06-23T17:31:18Z")

</div>

Why not setup a conference call, invite interested people and discuss a complete roadmap and assign tasks?

I am in by the way. 🙂
