Skip to content

Latest commit

 

History

History

protocol-client

Protocol Client

Summary

This library contains All GraphQL queries & mutation in addition to clients. Clients are wrappers around the sdk that contains a very specific operations for each table. You can think of clients as a Facade pattern for each table.

Nx Plugin

This App is generated using @nrwl/node:application. Check all targets at project.json

Commands

  • yarn nx run protocol-client:generate-gql: runs graphql-codegen, generating code based on both the GraphQL schema (queries.graphql) and on the custom resolvers../../apps/protocol-api/src/prisma/resolvers).1

Add new GraphQL Query

  • first add new query to queries.graphql file.
  • run yarn nx run protocol-api:serve, to be able to load GraphQl Schema.
  • run yarn nx run protocol-client:generate-gql, protocol-types.ts will be updated with new modifications

.env Variables

  • PROTOCOL_URL: link to gql endpoint: http://localhost:4000/graphql.1

Footnotes

  1. Requires GraphQL server to be running, go to protocol-api:serve 2