GithubHelp home page GithubHelp logo

graphql_to_dart's Introduction

GraphQL To Dart

Generate Dart models from an GraphQL endpoint by running a simple command.

Usage

Add graphql_to_dart as a dev dependency.

    graphql_to_dart: 1.0.0

Create a graphql_config.yaml file in your project root directory.

A simple graphql_config.yaml file will look something like this:

    package_name: my_awesome_app
    graphql_endpoint: https://example.com/graphql
    models_directory_path: lib/graphql/models/
    type_override:
      id: int

Note: All options except type_override and dynamic_import_path are required.

Run the command flutter packages pub run graphql_to_dart if you are using Flutter, otherwise simply pub run graphql_to_dart.

You can find the generated models in the path you provided to models_directory_path argument in graphql_config.yaml.

When you set models_directory_path outside of lib/, import 'package:packagename/path/filename.dart'; is not applicable. Add option dynamic_import_path: false for import 'filename.dart'.

Milestones

  • Generate Models
  • Support Enum
  • Generate query, mutations and subscriptions strings compatible with graphql package.

graphql_to_dart's People

Contributors

hw-occasions avatar vikram25897 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

graphql_to_dart's Issues

Upgrade dependencies

All the dependencies could be upgraded to the latest.

Because every version of graphql_to_dart depends on graphql ^3.0.1 and myapp depends on graphql ^5.0.0, graphql_to_dart is forbidden.
So, because myapp depends on graphql_to_dart 1.0.0, version solving failed.

Can we get Input types as well?

Is Input types in scope of this package? This package seems great to me as It provides all the minimal stuff(minus enums), But I'm reluctant to use it at the moment as it doesn't have enum support or input type support

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.