Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rafaelalmeidatk/graphql-architecture-example
Simple example of a modulable GraphQL architecture
https://github.com/rafaelalmeidatk/graphql-architecture-example
graphql graphql-server nodejs
Last synced: 9 days ago
JSON representation
Simple example of a modulable GraphQL architecture
- Host: GitHub
- URL: https://github.com/rafaelalmeidatk/graphql-architecture-example
- Owner: rafaelalmeidatk
- License: mit
- Created: 2017-12-01T01:45:00.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-12-01T03:20:16.000Z (about 7 years ago)
- Last Synced: 2024-10-12T12:25:06.846Z (2 months ago)
- Topics: graphql, graphql-server, nodejs
- Language: JavaScript
- Size: 29.3 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GraphQL Architecture Example
Simple example of a modulable GraphQL architecture based on folders.## How it works
For each object in your system, you create a folder inside `/src/graphql/`. The folder will have to contains the following files:
* `*.graphql` - This file contains the type definitions regarding the object. You need at least one, but can have as many as you want (e.g. one for `type Query` and another one for `type Mutations`)
* `resolvers.js` - This file exports all the resolver functions declarated on the GraphQL filesAll folders are processed automaticaly by `/graphql/index.js`. You just make the new folder, create the necessary files and it will just work. No need to remember to import the folders or load something!
## Example structure
```
└── graphql
├── index.js
├── post
│ ├── resolvers.js
│ └── allTypeDefs.graphql
└── user
├── resolvers.js
├── mutations.graphql
└── queries.graphql
```