@northernv/vgql

3.0.9 • Public • Published

Schema for ...

.gitlab-ci.yml is located in https://gitlab.com/northernv/gitlab-ci-templates

Schema

  • Queries and Mutations are in queries.gql
  • Types are in types.gql

Templates

The client query/mutation/fragments are held in /t. These are used directly by the server when creating contract (integration) tests for the various GQL methods.

Client GQL files

Run the npm run build file to generate the frontend GQL files.

/static

Files ready to be consumed by React/Vue when using Apollo GraphQL loader

Usage

In Webpack

loaders: [
  {
    test: /\.(graphql|gql)$/,
    exclude: /node_modules/,
    loader: 'graphql-tag/loader'
  }
]

In the file

import Unit from '@northernv/vgql/static/unit.gql'

const { data, errors } = await this.$apollo.query({
  query: Unit,
  variables: {
    input: { ... },
  }
})

/json

Files ready to be consumed by Apollo, no need for graphql-tag

Usage

import Unit from '@northernv/vgql/json/unit'

const { data, errors } = await this.$apollo.query({
  query: Unit,
  variables: {
    input: { ... },
  }
})

/gql

Files used with graphql-tag

Usage

import Unit from '@northernv/vgql/gql/unit'
import gql from 'graphql-tag'

const { data, errors } = await this.$apollo.query({
  query: gql`Unit`,
  variables: {
    input: { ... },
  }
})

Directives

  • @timestamp: Adds createdAt, updatedAt, deletedAt properties to types timestamp-directive.js

Readme

Keywords

none

Package Sidebar

Install

npm i @northernv/vgql

Weekly Downloads

0

Version

3.0.9

License

UNLICENSED

Unpacked Size

672 kB

Total Files

571

Last publish

Collaborators

  • shanestillwell