1.0.20 • Published 4 years ago

shopify-graphql-mutationer v1.0.20

Weekly downloads
22
License
ISC
Repository
-
Last release
4 years ago

shopify-graphql-mutationer

Shopify GraphQL Mutation

Installation

This is an update to the package

shopify-graphql-mutationer

To install this package, you can run

npm install --save shopify-graphql-mutationer

Or

yarn add shopify-graphql-mutationer

Usage

  • Simple query
import GraphQL from "shopify-graphql-mutationer";

const GraphQLClient = new GraphQL("domain", "access-token");

const query = `query { shop { id } }`;

GraphQLClient
  .request(query)
  .then(data => console.log(JSON.stringify(data.shop, null, 2)))
  .catch(error => console.log(JSON.stringify(error, null, 2)));
  • Simple mutation
import GraphQL from "shopify-graphql-mutationer";

const GraphQLClient = new GraphQL("domain", "access-token");

const mutation = `
  mutation collectionCreate($input: CollectionInput!) {
    collectionCreate(input: $input) {
      collection {
        id
      }
    }
  }
`;

GraphQLClient
  .request(mutation, {
    input: {
      descriptionHtml: "Collection was created from GraphQL",
      title: "GraphQL Collection",
    },
  })
  .then(data => console.log(JSON.stringify(data, null, 2)))
  .catch(error => console.log(JSON.stringify(error, null, 2)));
1.0.20

4 years ago

1.0.19

4 years ago

1.0.18

4 years ago

1.0.17

4 years ago

1.0.16

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.4

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago