nickforall / freight Goto Github PK
View Code? Open in Web Editor NEW๐๐จ Dynamically create Absinthe GraphQL payload objects for mutations
License: MIT License
๐๐จ Dynamically create Absinthe GraphQL payload objects for mutations
License: MIT License
userUpdate(id: "043743d5-7b9e-4415-bf11-7ec2643ddb92", user: {
isAdmin: null
}) {
successful
user {
isAdmin
}
errors {
message
}
}
for example, throws the following error:
{
"errors": [
{
"message": "is_admin cannot be explicitely set to null"
}
]
}
Because the field is defined as is_admin
in the database
This adapter is responsible for converting names. Let users define their own language adapater in Freight config and use absinthe's one by default
Different applications have different needs, for now errors are a list of string, but I'm sure people want more customizable things in the future.
Don't prepend field name
Currently I'm only testing whether payloads get generated successfully with certain inputs, meaning the schema generation and middleware are not covered by tests :(
In Absinthe subscriptions using the trigger
call are triggered when the errors array is empty. Freight empties this array to move those errors to the payload.
The decision to trigger a subscription in absinthe are
Possible solutions would be to
Most of the docs of this project are written quickly, use mixed terms and miss parts.
There are some cases where an error shouldn't be in a payload, but should be just a normal GraphQL error. In my use-case I want to do this for authentication errors.
I don't know what the best solution is here, might just be allowing for a middleware in build_payload.
Better test constraint stuff, and add support where bugs are found
Not sure what's causing this, looks like some race condition
## Locations
/Users/nickvernij/awkward/station/lib/station_web/graphql/types/comment.ex:17
/Users/nickvernij/awkward/station/lib/station_web/graphql/types/space.ex:10
Absinthe type identifier :payload_error is not unique.
References to types must be unique.
> All types within a GraphQL schema must have unique names. No two provided
> types may have the same name. No provided type may have a name which
> conflicts with any built in types (including Scalar and Introspection
> types).
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.