docs: make the docs a bit clearer on schema oddities

This commit is contained in:
Zach Daniel 2021-03-12 09:19:19 -05:00
parent 885b1d886e
commit 2cb878af79

View file

@ -63,13 +63,12 @@ end
If you don't have an absinthe schema, you can create one just for ash
If you don't have any queries or mutations in your schema, you may
need to add empty query and mutation blocks. If you have no mutations,
don't add an empty mutations block, same for queries. Additionally,
define a `context/1` function, and call `AshGraphql.add_context/2` with
the current context and your apis. Additionally, add the `Absinthe.Middleware.Dataloader`
to your plugins, as shown below. If you're starting fresh, just copy the schema below and
adjust the module name and api name.
Define a `context/1` function, and call `AshGraphql.add_context/2` with the current context and your apis. Additionally, add the `Absinthe.Middleware.Dataloader` to your plugins, as shown below. If you're starting fresh, just copy the schema below and adjust the module name and api name.
### Temporary workaround
You will need an empty `query` block and `mutations` block in your schema, as shown below. If none of your resources define mutations, then leave the empty `mutations` block out.
```elixir
defmodule MyApp.Schema do