Comments (11)
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.
After bisecting 5f1b05b is the first bad commit
from absinthe.
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.
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.
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.
Any updates on this? Did you managed to find a workaround?
from absinthe.
Nothing on my end
from absinthe.
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.
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.
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.
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)
- Create release tags for 1.7.* releases HOT 1
- Dialyzer error when expecting "subscribed" key returned from Absinthe.run/3
- Subscriptions don't trigger with namespaced mutations
- Support deprecated input object fields in introspection query
- How do create multiple inputs ? In Mutations ? HOT 1
- Huge max_heap_size compared to the actual data size HOT 2
- "Unknown Registry" when publishing during node startup or shutdown HOT 6
- Subscription fails to resolve using default resolver if it there is a middleware specified HOT 2
- Allow subscriptions to listen to "regular" PubSub events HOT 1
- False positive error for non_null validation HOT 2
- Using GraphQL (and perhaps Absinthe) in messages? HOT 3
- small CSS issue on the Absinthe landing page HOT 3
- add support for `config` functions (on subscriptions) in hydrate/2
- Resolving field of type `[[Value]!]!]` seems to fail with valid values HOT 2
- Compilation infinite loop leaking memory HOT 5
- Introspection query fails when using a prototype schema that defines types for use by directive arguments HOT 3
- Not having access to `conn` leads to degraded DX and performance HOT 1
- Absinthe.Subscription.unsubscribe doesn't work HOT 4
- Proposal - add a GRAPHQL sigil HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from absinthe.