GraphQL Editor Guide
Search…
GraphQL Editor
Home
Graph
Schema Libraries
Cloud
Docs Generation
Microservices FaaS
JAMStack
CLI
Create a microservice project
Local GraphQL Server
Resolvers
Get the CI token
Deploy from repository
Powered By
GitBook
Resolvers
How to specify resolvers in repo
To specify resolvers in repo use CLI to add those with a command or manually edit stucco.json file.
Add a resolver
1
npx gecli resolver
Copied!
This command will interactively ask you about what resolver code you want to create.
Add manually
Given the
schema.graphql
in your repository looks like this:
schema.graphql
1
type
Query
{
2
hello
:
String
!
3
}
4
​
5
schema
{
6
query
:
Query
7
}
Copied!
You can specify the resolver as follows. As you see the
name
is the path to generated or
js
file.
stucco.json
1
{
2
"resolvers"
:
{
3
"Query.bundle"
:
{
4
"resolve"
:
{
5
"name"
:
"lib/Query/hello"
6
}
7
}
8
}
9
}
Copied!
hello.js
1
export
const
handler
=
()
=>
"world"
Copied!
Previous
Local GraphQL Server
Next
Get the CI token
Last modified
6mo ago
Copy link
Contents
Add a resolver
Add manually