-
Notifications
You must be signed in to change notification settings - Fork 0
/
example_config.yaml
51 lines (47 loc) · 1.67 KB
/
example_config.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# yaml-language-server: $schema=.vscode/configuration_schema.json
# Common config for all endpoints
common:
path_prefix: "/api/v1"
listen: "0.0.0.0:3000"
graphql_endpoint: "https://localhost:3000/"
logging:
level: info
# A list of all the new endpoints to create
endpoints:
# Create an endpoint that requires the id in the path
- path: "/users/:id"
pq_id: "123456789"
path_arguments:
# Map the arguments to the GraphQL arg called $userId
- from: "id"
to: "userId"
- path: "/products"
pq_id: "123456789"
# API for all users with url params
- path: "/users"
pq_id: "123456789"
# Look for these values in the url query params
# Maps `/users?sort=X` to GQL `query GetUsers(userSort: String!) { ... }`
query_params:
- from: "sort"
to: "userSortInput"
required: true
# Mutation for updating the user’s email
- path: "/users/:id/email"
method: "PATCH"
pq_id: "123456789"
path_arguments:
# Map the arguments to the GraphQL arg called $userId
# This will be added as a root variable joined on the object below
- from: "id"
to: "userId"
# Since the GraphQL variables are just a JSON object,
# an easy way to pass complicated input types is to just put it in the body
# and pass that on as-is to the GraphQL input
# { “input”: { “email”: “[email protected]”, “sendNotification”: true } }
body_params:
- from: "email"
required: false
- from: "sendNotification"
required: false
kind: boolean