ash-project / ash_hq

The Ash Framework homepage and documentation site.
MIT License
46 stars 25 forks source link

Unclear section on "Getting Started With Graphql" #122

Open bravely opened 11 months ago

bravely commented 11 months ago

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.

zachdaniel commented 11 months ago

Ah, right, we've deprecated the need for those now. Would you like to PR the removal of that information? I'm happy to do it if not.

bravely commented 11 months ago

Sure, I'll see about getting to it when I get the chance. Haven't gotten to properly check out Ash yet!

juhalehtonen commented 7 months ago

This seems to be fixed :)