Skip to content

Unclear section on "Getting Started With Graphql" #122

@bravely

Description

@bravely

On the "Getting Started With Graphql" tutorial page, the "Add AshGraphql to your schema" section(link) includes a lot of instructions that aren't referenced in the code block below.

Excerpt:

Add AshGraphql to your schema

If you don’t have an absinthe schema, you can create one just for ash.
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.

Then, the code block beneath neither contains anything about context, Dataloader, or plugins:

defmodule Helpdesk.Schema do
  use Absinthe.Schema

  @apis [Helpdesk.Support]

  use AshGraphql, apis: @apis

  # The query and mutation blocks is where you can add custom absinthe code
  query do
  end

  mutation do
  end
end

Additional context
If those are automatically created by calling use AshGraphql, apis: @apis then that should probably be spelled out.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions