mirror of
https://github.com/cypress-io/cypress.git
synced 2026-01-20 22:20:02 -06:00
* move to ts * refactor * test * type * fix tests * types * simplify update preferences via graphql * types * simplify * show config in editor * fix test * add description for mutation and update default prefernces * update schema * update docs * update description of localSettings field Co-authored-by: Mark Noonan <mark@cypress.io> Co-authored-by: Mark Noonan <oddlyaromatic@gmail.com>
GraphQL
The GraphQL layer that @packages/launchpad and @packages/runner use to interact with @packages/server.
With the goal of type safety, several tools and abstractions are used. The technologies are:
- nexus-graphql library for generating GraphQL schema using TypeScript objects
- graphql-code-generator generate TypeScript types from
gqlqueries (for front-end consuming the API)
This tutorial demonstrates how to build a type-safe GraphQL app using the above technologies. It's a good place to start, to learn how and why each tool is used.
Development
You will generally develop this in parallel with a front-end, in this case @packages/launchpad. Run yarn dev in @packages/launchpad and it will start up the GraphQL server. This also re-generates the graphql.schema file based on the declarations inside of entities.
Visit http://localhost:52200/graphql for the GraphiQL interface.
You can also develop in a test-driven manner using the tests.
yarn test-unitfor the unit testsyarn test-integrationfor the integration tests
