https://github.com/graphql-editor/gei-crud
GraphQL Editor integration for stucco. Allows basic crud operations and relations.
https://github.com/graphql-editor/gei-crud
Last synced: 8 months ago
JSON representation
GraphQL Editor integration for stucco. Allows basic crud operations and relations.
- Host: GitHub
- URL: https://github.com/graphql-editor/gei-crud
- Owner: graphql-editor
- Created: 2022-07-12T15:08:55.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-03-10T11:18:11.000Z (over 3 years ago)
- Last Synced: 2025-08-29T22:00:27.172Z (10 months ago)
- Language: TypeScript
- Size: 188 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# GraphQL Editor Integration - CRUD
This integration allows basic CRUD operations with mongodb as a database
## How to use in GraphQL Editor
1. Select `Type` and `field` in stucco config
2. Select `From integration`
3. Select `gei-crud/Query.objects` for objects or `gei-crud/Mutation.create` for Creation
## How to use in code
```sh
$ npm i gei-users
```
Add this to your `stucco.json` file
```json
{
"resolvers": {
".": {
"resolve": {
"name": "node_modules/gei-crud/lib/Query/objects"
}
},
".": {
"resolve": {
"name": "node_modules/gei-crud/lib/Mutation/create"
}
}
}
}
```
where `Type` and `fieldName` are defined for your schema, for example:
```json
{
"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.