Comments (12)
@dre1080 just wanted to give you an update. We've been looking through this and this bug has uncovered a slightly more general problem with handling complex input types. I'll be working on an improved implementation tomorrow, as we need this functionality ourselves too.
We hope to have it fixed very soon.
from absinthe.
@benwilson512 thanks. Looking forward to seeing this fixed
from absinthe.
@dre1080 hey! can you try now against master? The latest merge should have fixed this issue.
from absinthe.
@benwilson512 it seems like its working now π
All that's left is Relay integration for clientMutationId
from absinthe.
Yup we've got a whole library in the works for relay support, https://github.com/absinthe-graphql/absinthe_relay
from absinthe.
I am however getting this response when testing mutations,
{"errors":[{"message":"Variable `input_0.clientMutationId': Not present in schema","locations":[{"line":1,"column":0}]},{"message":"Variable `input_0.clientMutationId' (String): Not provided","locations":[{"line":1,"column":0}]}],"data":{}}
Same schema as before but added field :client_mutation_id, non_null(:string)
from absinthe.
Can you show an example test case? What's a minimal schema, variable value, and document needed to reproduce?
from absinthe.
Here's the schema I'm testing with:
defmodule API.Graph.Schema do
use Absinthe.Schema
alias API.Resolver
object :user do
field :id, :id
field :email, :string
field :name, :string
end
object :create_user_payload, name: "CreateUserPayload" do
field :user, :user
field :client_mutation_id, non_null(:string)
end
input_object :create_user_input, name: "CreateUserInput" do
field :email, non_null(:string)
field :name, non_null(:string)
field :client_mutation_id, non_null(:string)
end
mutation do
@desc "Create a user"
field :create_user, type: :create_user_payload do
arg :input, non_null(:create_user_input)
resolve &Resolver.User.create/2
end
end
query do
field :viewer, :user do
resolve &Resolver.User.current/2
end
end
end
This is the request payload:
{
query: "mutation createUserMutation($input_0:CreateUserInput){createUser(input:$input_0){clientMutationId}}"
variables: {input_0: {clientMutationId: "0", email: "[email protected]", name: "John"}}
}
from absinthe.
Ah hm maybe variables aren't run through the adapters? Hold up let me see if I can confirm.
from absinthe.
Yeah it's definitely that adapters aren't being used to coerce inner
variable values. I'll patch that in the morning, good catch thanks!
On Wednesday, March 9, 2016, andΓΆ [email protected] wrote:
Here's the schema I'm testing with:
defmodule API.Graph.Schema do
use Absinthe.Schemaalias API.Resolver
object :user do
field :id, :id
field :email, :string
field :name, :string
endobject :create_user_payload, name: "CreateUserPayload" do
field :user, :user
field :client_mutation_id, non_null(:string)
endinput_object :create_user_input, name: "CreateUserInput" do
field :email, non_null(:string)
field :name, non_null(:string)
field :client_mutation_id, non_null(:string)
endmutation do
@desc "Create a user"
field :create_user, type: :create_user_payload do
arg :input, non_null(:create_user_input)resolve &Resolver.User.create/2 end
end
query do
field :viewer, :user do
resolve &Resolver.User.current/2
end
end
endThis is the request payload:
{
query: "mutation createUserMutation($input_0:CreateUserInput){createUser(input:$input_0){clientMutationId}}"
variables: {input_0: {clientMutationId: "0", email: "[email protected] javascript:_e(%7B%7D,'cvml','[email protected]');", name: "John"}}
}β
Reply to this email directly or view it on GitHub
#65 (comment)
.
from absinthe.
Hey give it a shot now.
from absinthe.
@benwilson512 Closing this because I think this is handled. Reopen if necessary.
from absinthe.
Related Issues (20)
- 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
- Feature Request: customizable docset runner for Subscriptions HOT 1
- Open ended scalars don't support list values HOT 7
- schema compilation goes into infinite recurion HOT 1
- Warning you must add "compilers: [:yecc] ++ Mix.compilers()" after updating to elixir 1.16
- Strings containing only whitespace are being trimmed to an empty string HOT 3
- Absinthe.Formatter.format/2 formats input: into one very long line 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.