gei-crud
v0.9.6
Published
GraphQL Editor integration for stucco. Allows basic crud operations and relations.
Downloads
39
Readme
GraphQL Editor Integration - CRUD
This integration allows basic CRUD operations with mongodb as a database
How to use in GraphQL Editor
- Select
Type
andfield
in stucco config - Select
From integration
- Select
gei-crud/Query.objects
for objects orgei-crud/Mutation.create
for Creation
How to use in code
$ npm i gei-users
Add this to your stucco.json
file
{
"resolvers": {
"<Type>.<fieldName>": {
"resolve": {
"name": "node_modules/gei-crud/lib/Query/objects"
}
},
"<Type>.<fieldName>": {
"resolve": {
"name": "node_modules/gei-crud/lib/Mutation/create"
}
}
}
}
where Type
and fieldName
are defined for your schema, for example:
{
"resolvers": {
"Query.posts": {
"data": {
"model": "Post"
},
"resolve": {
"name": "node_modules/gei-crud/lib/Query/objects"
}
},
"Mutation.createPost": {
"data": {
"model": "Post"
},
"resolve": {
"name": "node_modules/gei-crud/lib/Mutation/create"
}
}
}
}
They need to implement the SDL type parameters.