pantheon-systems / ariadne-extensions Goto Github PK
View Code? Open in Web Editor NEWSet of scripts and helper utilities to extend Ariadne GraphQL library
License: BSD 3-Clause "New" or "Revised" License
Set of scripts and helper utilities to extend Ariadne GraphQL library
License: BSD 3-Clause "New" or "Revised" License
While implementing Ariadne with Federation on top of my Flask Sqlalchemy app I have found an issue having my PublicUserNode
shared with other services on my apollo federation setup. I kept getting this error:
Abstract type _Entity must resolve to an Object type at runtime for field Query._entities with value <User instance>, received 'None'. Either the _Entity type should provide a "resolve_type" function or each possible type should provide an "is_type_of" function.
The reason why I was getting it its because FederationManager._entity_type_resolver was looking for the type name either on the class name, which would not work in my case since my model class name is User
and not PublicUserNode
, or an AriadneMeta
property which is undocumented.
My problem was solved by injecting AriadneMeta
property into my model instance inside the federation object type's resolve_reference
method, but I had to go through the source code to figure out what was missing.
I'd like to suggest to add it to the documentation and create a way to declare the type to be resolved, specially if you have multiple types to represent the same data class.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.