Skip to content

Commit

Permalink
Fix Grafserv docs
Browse files Browse the repository at this point in the history
  • Loading branch information
benjie committed Sep 19, 2023
1 parent 78a04b8 commit a7f34d5
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions grafast/website/grafserv/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,25 @@ const serv = grafserv({ schema, preset });
```

`grafserv` is passed the GraphQL schema to use (if it's available, otherwise
passing either null or a promise is also acceptable) and a `graphql-config`
preset - i.e. your configuration.
passing either null or a promise is also acceptable) and a `graphile-config`
preset - i.e. your configuration. The preset can be an empty object, but here's
a bigger (but not exhaustive) example:

```js
const preset = {
grafserv: {
port: 5678,
host: "0.0.0.0",
dangerouslyAllowAllCORSRequests: false,
graphqlPath: "/graphql",
eventStreamPath: "/graphql/stream",
graphqlOverGET: true,
graphiql: true,
graphiqlPath: "/",
websockets: true,
},
};
```

Calling `grafserv` will return an instance; this instance will have a number of
helpers on it, including helpers specific to integrating it with your framework
Expand Down

0 comments on commit a7f34d5

Please sign in to comment.