How to use Relay / GraphQL with Loopback?

Any working solutions using Relay / GraphQL with Loopback? I assume that a few things that I consider are access to the database (since I assume that it will not be possible through ORM) and how to use api generators when using Relay / GraphQL ...

+7
source share
3 answers

Just for other people, I came across this answer, and I was still confused about whether I could implement GraphQL api in Loopback or not. I used the Apollo apollo-server package for Express. Since Loopback is based on Express, calling

app.use('/graphql', bodyParser.json(), graphqlExpress({schema})); app.use('graphiql', graphiqlExpress({ endpointURL: "/graphql" })) 

works great. Just follow the instructions for the Express code and it should work. As for the database stuff, it seems that you can use converters as a middle tier instead of remote Loopback methods. For each resolver that points to a piece of data, you can call the context method app to retrieve data from your database.

+2
source

I created this npm library to create a GraphQL schema from loopback models: https://github.com/Tallyb/loopback-graphql

+6
source

tewstjjhj jhjji; jhjhjhj tewstjjhj jhjji; jhjhjhj tewstjjhj jhjji; jhjhjhj tewstjjhj jhjji; jhjhjhj tewstjjhj jhjji; jhjhjhj tewstjjhj jhjji; jhjhjhj tewstjjhj jhjji; jhjhjhj

-6
source

All Articles