Comments (6)
Looks like for some reason this case
is not matching, and it's proceeding to the next one, where it crashes.
from clue.
So I've been staring at this one, and actually I am not sure if it's supposed to workโat least not in general. I think the issue is this bit:
... on Gcal $GcalStepConfigSubquery
I have a recollection that we discussed at one point, how fragments and subqueries actually do not mix. Because in the general case fragments are actually defining a new result type (that would not match the subquery's type).
e.g. in this example, fragments are creating a new result type that includes name
. If on Droid
or on Human
was a subquery, it would not include name
and thus those datatypes cannot be used.
query HeroForEpisode($ep: Episode!) {
hero(episode: $ep) {
name
... on Droid {
primaryFunction
}
... on Human {
height
}
}
}
If my analysis is correct, then I think we should consider:
- arguably this is a special case, since you are only expanding a single fragment with no other fields. So should it get special treatment?
- otherwise this probably deserves a nicer error message :)
Thoughts?
from clue.
You are totally right. Interface queries don't necessarily materialize into an instance. We should extract a subquery on the actual instantiated type (hero
in your example).
We could still define reusable blocks for these cases (ie: special case), and I think it would be just a string with the subquery (no output type or decoder), only that we would have to resolve the interpolation at compile time, like we do for actual subqueries. I wonder if this is worthwhile, thoughts? Do you think this it's straightforward or that I'm missing something?
from clue.
We could still define reusable blocks for these cases (ie: special case), and I think it would be just a string with the subquery (no output type or decoder), only that we would have to resolve the interpolation at compile time, like we do for actual subqueries.
Oh, I see! So in this case, we just want to interpolate the string part of the query, and not share/reuse data classes? Did I understand correctly?
from clue.
Oh, I see! So in this case, we just want to interpolate the string part of the query, and not share/reuse data classes? Did I understand correctly?
Yes, that's what I mean. In other words, compile-time concatenation. It might be useful too when there are common fields but not a common interface. WDYT?
from clue.
Yes, I do think that would be useful! I actually attempted that when I first started working on subqueries, because I assumed it would be helpful. It turned out to be difficult and not strictly needed ๐
I still have the branch lying around, I can give it another shot :) the strategy I was trying to use there, was that the Scala compiler will automatically concatenate final val
strings at compile time. So I was hoping we could tap into that somehow.
https://github.com/gemini-hlsw/clue/commits/pr/final-val-document
from clue.
Related Issues (13)
- Reusable fragments HOT 1
- Scala.js classes for results? HOT 9
- Publish for JDK 8, test on JDK 11+? HOT 2
- Determine if scalafix generator is working in Scala 3
- "Spec" compliance
- Do not reset connection retry counter if the connection drops less than X millis since being established
- Update Grackle
- Don't close subscription on error HOT 1
- Contemplate the fact that a query can return both data and errors HOT 1
- Support extensions in queries HOT 1
- Support setting per request headers for transactional clients HOT 1
- Support some queries failing and some suceeding when batching 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 clue.