https://github.com/doums/marbre
A GraphQL server with pure Code-First approach out of the box.
https://github.com/doums/marbre
code-first graphql graphql-server
Last synced: 4 days ago
JSON representation
A GraphQL server with pure Code-First approach out of the box.
- Host: GitHub
- URL: https://github.com/doums/marbre
- Owner: doums
- Created: 2022-10-09T22:52:02.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-10-11T21:39:01.000Z (over 3 years ago)
- Last Synced: 2025-07-02T10:04:56.025Z (7 months ago)
- Topics: code-first, graphql, graphql-server
- Language: TypeScript
- Homepage:
- Size: 293 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Marbre
A GraphQL server with pure Code-First approach out of the box.
Stack:
- [Typescript](https://www.typescriptlang.org/)
- [Fastify](https://www.fastify.io/)
- [Apollo Server](https://www.apollographql.com/docs/apollo-server/)
- [Nexus](https://nexusjs.org/docs/)
The server is built using a simple Fastify application and Apollo
server is consumed as a middleware in order to keep the maximum
flexibility.
The GraphQL layer embraces the "[code
first](https://www.prisma.io/blog/introducing-graphql-nexus-code-first-graphql-server-development-ll6s1yy5cxl5)"
approach using Nexus.
### Features
- code first approach
- strong type-safety
- declarative configuration
- flexibility, you have access to the Fastify app
- configuration fully documented (TSDoc)
### Usage
```typescript
import { join } from 'path';
import { v4 as uuid } from 'uuid';
import Marbre from 'marbre';
import { context } from './api';
import { PORT } from './env';
import * as types from './graphql';
const marbre = new Marbre({
types,
context,
contextType: {
module: join(__dirname, 'api/context.ts'),
name: 'GqlContext',
},
sourceTypes: join(__dirname, 'api/sourceTypes.ts'),
outputDir: join(__dirname, 'api/generated/'),
port: PORT,
fastify: {
genReqId: () => uuid(),
},
});
(async () => {
await marbre.start();
})();
```
### License
Mozilla Public License v2.0