@wizzit-clients/core

0.0.8 • Public • Published

GraphQL Client Wrapper

Usage

Basic client

import gql from "graphql-tag";
import { createClient } from "@wizzit-clients/core";
import { name, version } from "./package.json";
import { resolvers } from "./resolvers"

const typeDefs = gql`
  type Query {
    ping: Boolean!
  }
`

export default createClient({
  name,
  version,
  typeDefs,
  resolvers
})

Stitch together client with remote schema

import gql from "graphql-tag";
import { createClientFromSchemas } from "@wizzit-clients/core";
import example from "@wizzit-clients/example";

export default createClientFromSchemas({
  remoteSchemas: [
    { uri: "https://localhost:4000/graphql" },
  ],
  localSchemas: [
    example,
  ],
})

Dependents (1)

Package Sidebar

Install

npm i @wizzit-clients/core

Weekly Downloads

1

Version

0.0.8

License

none

Unpacked Size

7.61 kB

Total Files

6

Last publish

Collaborators

  • betaplum