Comments (4)
@yanns - No worries and I also just came back from my holiday.
As suggested, I raised #952 to demonstrate the unexpected behaviours related to arbitrary input objects and Args
. From what I can see, the tests indicate the following:
- build with custom input argument: arguments of custom input types work fine as long as they are not optional;
- build with optional custom input argument and defined input: optional arguments of custom input types wrap the optional results inside another
Option
(e.g.Some(Some(CustomInput("Hello Sangria")))
);
The findings above match what I observed previously, although circeDecoderFromInput
from sangria-circe was used in my original code snippet, but I'm using argonautDecoderFromInput
from sangria-argonaut in the tests to be consistent with other existing ones.
from sangria.
@yanns - Amazing! @@ InputObjectResult
does fix the problem!
It makes sense to me now that we need the @@
tags in the following argument scenarios:
- Optional Object types:
Argument[Option[EchoMessageInput @@ InputObjectResult]]
- Optional Scala types:
Argument[Option[Int @@ CoercedScalaResult]]
Thanks so much for your help!
from sangria.
Thanks for the detailed report. Sorry I missed the notification somehow.
At first sight, I thought it was similar to #434
But I'm not totally sure.
Could you open a PR with a failing test in https://github.com/sangria-graphql/sangria/blob/main/modules/core/src/test/scala/sangria/schema/ArgsSpec.scala ?
from sangria.
Thanks a lot for the PR!
By using @@ InputObjectResult
, I could make it work: 4d81bbf
Is it something that also fix your case?
from sangria.
Related Issues (20)
- It is impossible to override an built-in scalar HOT 1
- Decoding failure HOT 9
- Unnecessary implicit conversion while using experimental catseffect `AsyncValue` HOT 2
- Change context object
- Support OneOf on Input Objects HOT 2
- Website is down HOT 1
- Looking for help / maintainers
- Main documentation seems to not link to scaladoc / javadoc HOT 1
- Build a Sangria Steward
- Scala 3 Derive Macro Compiler Error HOT 9
- Scala 3: Exception returning Future values from GraphQL Endpoint HOT 1
- [scala3] sangria-relay HOT 1
- Error behavior when `name` argument to ObjectType constructor contains a space HOT 5
- Query/Schema validation for default values on object type field arguments not captured (ValueOfCorrectType rule) HOT 2
- Using `Option` in fields fails in the `None` case HOT 8
- `ListInputType[T]` extending `InputType[Seq[T]]` HOT 5
- support @deprecated on argument and input field HOT 1
- The custom scalars do not parse underlying model HOT 3
- Long type user input coercion missing implicit conversion from java.math.BigDecimal HOT 5
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 sangria.