Comments (10)
Ok, I think I found a solution with the use typeOverrides
map, but I need to check it. I will back to you
from ferry.
Do you also have multiple operations in the same file in your larger project?
from ferry.
Yes, I group related queries and mutations for the same objects in a single file.
from ferry.
Thanks! can you reproduce this issue when you put all operations in a separate file?
from ferry.
No, code is fine when I put the mutation in a separate graphql file.
I tested different variations of putting operations in single files, grouping them slightly, etc. and stumbled on this:
If I put both operations in the same file like this, I get the wrong imports prefixes:
query Pokemons {
pokemons {
id
name
}
}
mutation UpdatePokemon($id: ID!, $name: String) {
updatePokemon(id: $id, name: $name) {
id
name
}
}
If I switch them around and rerun build_runner, I get no errors in the generated files:
mutation UpdatePokemon($id: ID!, $name: String) {
updatePokemon(id: $id, name: $name) {
id
name
}
}
query Pokemons {
pokemons {
id
name
}
}
So I don't think it's related to grouping them or spreading them into separate files.
from ferry.
The first problem is here:
because of that typeDefNode
is always null and then isBuilder
is true and it uses replace
instead of the value assignment operator (=).
And even if originalSymbolName
would be fine, in the case of CustomDate
it still won't work, because the name of the Node is Date
(so the name of the Scalar, not the custom class we've created)
Unfortunately, I cannot find any simple way to overcome it for now 🤔
@knaeckeKami any tips?
from ferry.
Hm I am a little bit blocked.
I think the problem is that during generating schema.schema.gql.dart
file it uses 2 different allocators for input classes and input serializer classes.
I also think that the error is inside ferry_generator
package, because generating the code with the use of clean gql_builder works fine and it only breaks when using ferry_generator
.
But unfortunately, I am not so familiar with that code and cannot spot the error 🤔
from ferry.
Ok, no worries, I'll take a look at it.
I also think it's related to the Allocators.
from ferry.
I think I found it 😃 I can create PR soon 👌
from ferry.
Here is the fix #583 for the aforementioned issue (Test fails 😞 )
and another fix is here gql-dart/gql#448
from ferry.
Related Issues (20)
- Cannot use `tristate_optionals: true` in mutations having lists in their parameters HOT 5
- Custom ISO serializer for DateTime HOT 5
- How to remove the `__typename` in the `toJson` of a fragment HOT 2
- Change in cache doesn't propagate HOT 28
- [Feature Request] Add `ContextEntries` to requests that can be retrieved in custom `gql` `Link` HOT 9
- [Feature Request] Access properties using Maps (ferry_generator) HOT 3
- [question]: Freezed support HOT 4
- [Feature Request] a CLI that output unused field/argument in the schema HOT 1
- Unable to Upload Multipart File with dio link HOT 2
- ferry_flutter: endless loading state after the cache has been cleared HOT 1
- Null check operator used on a null value and "Bad Element" HOT 1
- schema.schema.gql.dart not generated - "possibleTypesMap" missing HOT 3
- Ferry cannot decompose fragment on TypeCondition HOT 1
- Manually update the ferry data HOT 1
- TypePolicy is broken Or there is no clear documentation about it. HOT 12
- The relevant error-causing widget was:
- [Feature Request] Export request query to graphql HOT 1
- Non-dev dependency in ferry_generator package HOT 2
- Simple example calling a mutation on click and handling the response HOT 7
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 ferry.