Comments (8)
This is probably because I still haven't updated to the latest codegen api (#2)
You can try with "graphql-code-generator": "^0.12.6"
, but it is still very experimental
from graphql-to-dart.
Version 0.1.0-alpha1
should now work with [email protected]
from graphql-to-dart.
I have tested with the following package.json
{
"devDependencies": {
"graphql": "^14.1.1",
"graphql-code-generator": "^0.18.0",
"graphql-codegen-typescript-common": "^0.17.0",
"graphql-codegen-typescript-server": "^0.17.0",
"graphql-to-dart": "0.1.0-alpha1"
}
}
and get this error:
.bin/gql-gen
✔ Parse configuration
❯ Generate outputs
❯ Generate lib/serializers/graphql.dart
✖ Load GraphQL schemas
→ Must provide Source. Received: {}
Load GraphQL documents
Generate
Found 1 error
✖ lib/serializers/graphql.dart
TypeError: Must provide Source. Received: {}
Something went wrong
error Command failed with exit code 1.
from graphql-to-dart.
sorry, try with 0.1.0-alpha3
. npm publish
doesn't seem to include dist/
be default anymore
from graphql-to-dart.
unfortunately i get exactly the same issue :( . Did you try by yourself ? can you add a test with a yaml to check that it is working ?
from graphql-to-dart.
I did - found one issue while testing different configs and published fix as 0.1.1-alpha
, but it doesn't look like the same issue. I was able to generate output with just
schema: "./schema/__generated__/schema.json"
documents:
- "./lib/gql/raw/recordFragments.gql"
- "./lib/gql/raw/metricFragments.gql"
- "./lib/gql/raw/eventFragments.gql"
- "./lib/gql/raw/GetSchedule.gql"
- "./lib/gql/raw/GetFreeforms.gql"
- "./lib/gql/raw/GetUserEventRecords.gql"
- "./lib/gql/raw/GetUserMetrics.gql"
- "./lib/gql/raw/UpsertEventRecord.gql"
- "./lib/gql/raw/UpsertEvent.gql"
overwrite: true
generates:
lib/serializers/graphql.dart:
plugins:
- graphql-to-dart
from graphql-to-dart.
It is OK now with the following codegen.yml file
With the following configuration a dart file is generated.
Now I get the issue with scalar type (I18n).
Can you please advice how to add Scalar feature in codegen.yml file ?
schema: "<url_gate>/graphql"
documents:
overwrite: true
generates:
lib/serializers/graphql.dart:
plugins:
- graphql-to-dart
from graphql-to-dart.
@fvisticot answered in #5 here, closing this as resolved
from graphql-to-dart.
Related Issues (20)
- generating example file from schema
- because of helpers like .empty(), having invalid types is easy. We should validate not null somehow HOT 3
- Non nullable fields in graphql vs required fields in models HOT 5
- Cannot install HOT 1
- leverage equatable or other value-based equivalence
- Problem with aliases (on master) HOT 3
- Union Type Does Not Convert HOT 6
- Inline fragments are broken, unions won't be deserialized HOT 5
- Document using fragment causing issues when expanding fields that already exist in fragment HOT 2
- Discussion: Bake gql inside of a more global operation class HOT 1
- fragment merging HOT 1
- eventually switch to built value
- merge should map only to base types, base type methods should be respected HOT 3
- toJson() should not include items which were not set HOT 1
- Feature Request: fromJson() constructor HOT 1
- Code Generation Error "undefined_class" HOT 1
- Error compiling generated Dart File HOT 4
- Optional can not start with underscore. HOT 1
- Override schema types of specific fields with custom scalars HOT 3
- Include documents in output HOT 2
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 graphql-to-dart.