Git Product home page Git Product logo

Comments (11)

maartenvanvliet avatar maartenvanvliet commented on June 1, 2024 1

The digraph removal wasn't merged yet, so it's not related.

Seeing Jose's comment, it could be very well be something in OTP changing.

As there are multiple places where code is generated in Absinthe, this warning was helpful in catching bugs.

from absinthe.

MaeIsBad avatar MaeIsBad commented on June 1, 2024

After bisecting 5f1b05b is the first bad commit

from absinthe.

MaeIsBad avatar MaeIsBad commented on June 1, 2024

This patch

diff --git a/lib/absinthe/phase/schema/build.ex b/lib/absinthe/phase/schema/build.ex
index a5b5f895..b917017f 100644
--- a/lib/absinthe/phase/schema/build.ex
+++ b/lib/absinthe/phase/schema/build.ex
@@ -5,12 +5,15 @@ defmodule Absinthe.Phase.Schema.Build do
     %{schema_definitions: [schema]} = blueprint

     types = build_types(blueprint)
-    directive_artifacts = build_directives(blueprint)
+
+    directive_artifacts =
+      (schema.directive_artifacts ++ build_directives(blueprint))
+      |> Enum.dedup_by(fn v -> v.identifier end)

     schema = %{
       schema
       | type_artifacts: types,
-        directive_artifacts: schema.directive_artifacts ++ directive_artifacts
+        directive_artifacts: directive_artifacts
     }

     blueprint = %{blueprint | schema_definitions: [schema]}

fixes 2/4 warnings, without breaking tests but a duplicate
__absinthe_directive__(:include)
and
__absinthe_directive__("include")
functions still get generated

from absinthe.

rlopzc avatar rlopzc commented on June 1, 2024

We are using federation and 1.7.1 also broke stuff.

From our debugging session: It seems like the link directive broke? It returns null for a particular field required by the introspection query, and that in turn causes backend to throw

edit:
downgrading to 1.7.0 fixed the issue for us, we are back on 🟢

from absinthe.

MaeIsBad avatar MaeIsBad commented on June 1, 2024

I think you should open a separate issue for that, since it sounds like absinthe stopped working for you completely instead of just generating a warning, which seems way more severe

from absinthe.

edisonywh avatar edisonywh commented on June 1, 2024

Any updates on this? Did you managed to find a workaround?

from absinthe.

MaeIsBad avatar MaeIsBad commented on June 1, 2024

Nothing on my end

from absinthe.

maartenvanvliet avatar maartenvanvliet commented on June 1, 2024

When importing directives from the prototype it duplicates some of them. So something along the lines in the patch file above would work. Replacing Enum.dedup_by with Enum.uniq_by would improve upon it IMO, as there's no guarantee that the directives are consecutive. Feel free to file a PR.

Whilst investigating, I found a similar bug happens with the extend notation, this can also cause multiple functions with the same function heads to be generated. This is trickier to solve though.

I'm puzzled why this gives errors for elixir < 1.13, but no longer for elixir 1.13. Cannot find anything in the changelog of elixir that points to this.

from absinthe.

MaeIsBad avatar MaeIsBad commented on June 1, 2024

Replacing Enum.dedup_by with Enum.uniq_by would improve upon it IMO, as there's no guarantee that the directives are consecutive. Feel free to file a PR.

Ahh, that's why my patch still generated errors for include directives. Thanks! I'll open a PR

from absinthe.

benwilson512 avatar benwilson512 commented on June 1, 2024

Hey folks, I am having difficulty reproducing this. If I compile the example module on Elixir 1.13.4 OTP 25 I do not get any warnings. Let me see if I can get OTP 24 installed.

from absinthe.

benwilson512 avatar benwilson512 commented on June 1, 2024

Ah! So I think the actual change is OTP 24 vs OTP 25. No matter what Elixir version I run on OTP 25 (within those that are supported) I get no warnings, but if I use OTP 24 I do. @maartenvanvliet is this related to the removal of the digraph stuff?

from absinthe.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.