cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Automatic creation of REST-API endpoints based on GraphQL endpoint and introspection

Hi guys,

I have the setting of a neo4j database and on top of that a GraphQL endpoint based on a schema and the Neo4j GraphQL library (3.x).

I would like to have also REST-endpoints for some programmers convenience to CRUD the data. As I'm spoiled with the ease and automatic how the neo4j GraphQL library does that, I wonder if some of you have hints for me.

My approach ist to use GraphQL introspection to retrieve the types from the GraphQL endpoint analyse it and then create endpoints based on the result. By this a change of the schema will automatically change the GraphQL endpoint and by eventually automatically (!) the REST endpoint.
I create this mechansim by hand as it is worthwhile by creating automation.

Do you have suggestions? Maybe the Javascript sofa API can help? Does anyone use it?

Thanks for your feedback!

1 REPLY 1

William_Lyon
Graph Fellow

The SOFA project you linked looks interesting. I haven't seen it used with the Neo4j GraphQL Library, but looking through the docs I don't see any reasons it shouldn't work. Did you try it? Curious if it worked out for you?

Another thing to consider is the Neo4j GraphQL Library's OGM package. While it won't autogenerate a REST API,  it can be used with the same GraphQL type definitions as used for the GraphQL API to define your models. It then exposes a programmatic API that can be used when defining the routes for your REST endpoints.

Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit

All the sessions of the conference are now available online