1 | # graphql-config-extension-prisma
|
2 |
|
3 | [![CircleCI](https://circleci.com/gh/prisma/graphql-config-extension-prisma.svg?style=shield)](https://circleci.com/gh/prisma/graphql-config-extension-prisma) [![npm version](https://badge.fury.io/js/graphql-config-extension-prisma.svg)](https://badge.fury.io/js/graphql-config-extension-prisma)
|
4 |
|
5 | Injects endpoints and headers into a GraphQL Config instance based on a given prisma.yml
|
6 |
|
7 | ## Usage in `.graphqlconfig.yml`
|
8 |
|
9 | ```yml
|
10 | projects:
|
11 | database:
|
12 | extensions:
|
13 | prisma: prisma.yml
|
14 | ```
|
15 |
|
16 | ## Usage in Node.js
|
17 |
|
18 | ```ts
|
19 | import { patchConfig } from 'graphql-config-extension-prisma'
|
20 | import { getGraphQLConfig, GraphQLConfigData } from 'graphql-config'
|
21 |
|
22 | const config: GraphQLConfigData = getGraphQLConfig().config
|
23 | const patchedConfig: GraphQLConfigData = patchConfig(
|
24 | config,
|
25 | process.cwd(),
|
26 | )
|
27 | ```
|
28 |
|
29 | ## Current Usages
|
30 |
|
31 | This is currently being used in the [graphql-playground-html](https://github.com/graphcool/graphql-playground/tree/master/packages/graphql-playground-html) and [graphql-playgorund-electron](https://github.com/graphcool/graphql-playground/tree/master/packages/graphql-playground-electron).
|
32 |
|