absinthe-graphql / absinthe

The GraphQL toolkit for Elixir
http://absinthe-graphql.org
Other
4.28k stars 524 forks source link

[Bug] 1.7.7 no persistent term stored with this key #1325

Closed phanmn closed 2 months ago

phanmn commented 2 months ago

If submitting a bug, please provide the following:

Environment

Expected behavior

No error

Actual behavior

no persistent term stored with this key

Relevant Schema/Middleware Code

Work on 1.7.6, very simple schema

benwilson512 commented 2 months ago

Hi @phanmn can you confirm that you have the supervision child in your supervision tree?

phanmn commented 2 months ago

I comfirm I have the supervision child in my supervision tree. As I said I changed to 1.7.6 it works normally

luhagel commented 2 months ago

This happens to me since the update as well, only with the PersistentTerm provider enabled though. Turning that off leads to another problem though, in the form of a warning: redefining module MyAppWeb.Schema.Compiled which causes all queries to fail unless i delete the beam file in question before every server start

benwilson512 commented 2 months ago

If either of you could provide a small sample project that exhibits this behavior that would be very helpful.

luhagel commented 2 months ago

@benwilson512 Trying to cobble one together when i get a bit of time 👍

luhagel commented 2 months ago

@benwilson512 There you go: https://github.com/luhagel/absinthe_persistent_term No magic in there, create a new project with the newest phx.new, add absinthe, create a minimalistic schema, add the routing config and it goes boom once you try to run anything against it.

defmodule AbsinthePersistentTermWeb.Schema do
  use Absinthe.Schema
  @schema_provider Absinthe.Schema.PersistentTerm

  query do
    field :hello, :string do
      resolve(& &1)
    end
  end
end
benwilson512 commented 2 months ago

Hey @luhagel thanks, looking into it.

benwilson512 commented 2 months ago

Fixed by https://github.com/absinthe-graphql/absinthe/pull/1326.

benwilson512 commented 2 months ago

I'll release 1.7.8 here shortly if you can confirm this resolves the issue in your app too.

VictorGaiva commented 2 months ago

This also fixed an issue I was having when attempting to update to 1.7.7. My CI would call mix absinthe.schema.sdl --schema Gateway.Schema, that would fail due to not finding the definition for some fields.

luhagel commented 2 months ago

@benwilson512 fixed it for me 👍

benwilson512 commented 2 months ago

1.7.8 has been pushed with this fix.