graphql_starwars_test_server 0.1.0

Dart native

A stand-alone GraphQL test server built with angel dart. Adapted from [example_star_wars](https://github.com/angel-dart/graphql/tree/master/example_star_wars)

A simple starwars schema server adapted from the angel starwars example for use in testing graphql clients, such as graphql_flutter.

The schema it aims to implement is in schema.graphql, and the seed data is mostly in data.json. The server is heavily limited:

  • recursive relationships aren't entirely supported
  • a lot of mutations seem broken

To run, add as a dependency and

pub run graphql_starwars_test_server
  # --host 127.0.0.1
  # --port 3000
  # --enableCors true      # false to disable cors
  # --generateReviews true # false to disable review generation
                           # for subscription testing

Here are some working test operations:

mutation {
  modifyHuman(id: "1001", data: { name: "Anikin" }) {
    id
    name
    friends {
      name
    }
  }
}

{
  humans {
    id
    name
    friends {
      name
    }
  }
}

subscription reviewAdded {
  reviewAdded {
    stars
    commentary
    episode
  }
}

The server will generate a fake review for testing streams every 10 seconds, unless --generateReviews=false

schema.graphql generated with get-graphql-schema http://127.0.0.1:3000/graphql > schema.graphql

You can also disable cors with the env variable --enableCors=false

0
likes
65
pub points
66%
popularity

A stand-alone GraphQL test server built with angel dart. Adapted from [example_star_wars](https://github.com/angel-dart/graphql/tree/master/example_star_wars)

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

rosenthalm93@gmail.com

License

MIT (LICENSE)

Dependencies

angel_container, angel_cors, angel_framework, angel_graphql, angel_http_exception, angel_model, angel_serialize, angel_typed_service, args, async, graphql_parser, graphql_schema, graphql_server, io, logging

More

Packages that depend on graphql_starwars_test_server