Skip to content

Commit

Permalink
Add some basic docs on the new config file
Browse files Browse the repository at this point in the history
  • Loading branch information
vektah committed Jul 8, 2018
1 parent a9c3af8 commit 6391596
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions docs/content/config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
linkTitle: Configuration
title: How to configure gqlgen using gqlgen.yml
description: How to configure gqlgen using gqlgen.yml
menu: main
weight: -7
---

gqlgen can be configured using a `gqlgen.yml` file, by default it will be loaded from the current directory, or any parent directory.

Example:
```yml
schema: schema.graphql

# Let gqlgen know where to put the generated server
exec:
filename: graph/generated/generated.go
package: generated

# Let gqlgen know where to the generated models (if any)
model:
filename: models/generated.go
package: models

# Tell gqlgen about any existing models you want to reuse for
# graphql. These normally come from the db or a remote api.
models:
User:
model: github.com/my/app/models.User
Todo:
model: github.com/my/app/models.Todo
fields:
id:
resolver: true # force a resolver to be generated
```
Everything has defaults, so add things as you need.

0 comments on commit 6391596

Please sign in to comment.