Coder Social home page Coder Social logo

Comments (8)

micimize avatar micimize commented on June 17, 2024

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.

micimize avatar micimize commented on June 17, 2024

Version 0.1.0-alpha1 should now work with [email protected]

from graphql-to-dart.

fvisticot avatar fvisticot commented on June 17, 2024

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.

micimize avatar micimize commented on June 17, 2024

sorry, try with 0.1.0-alpha3. npm publish doesn't seem to include dist/ be default anymore 😅

from graphql-to-dart.

fvisticot avatar fvisticot commented on June 17, 2024

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.

micimize avatar micimize commented on June 17, 2024

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.

fvisticot avatar fvisticot commented on June 17, 2024

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.

micimize avatar micimize commented on June 17, 2024

@fvisticot answered in #5 here, closing this as resolved

from graphql-to-dart.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.