1.0.20 • Published 5 years ago

shopify-graphql-mutationer v1.0.20

Weekly downloads
22
License
ISC
Repository
-
Last release
5 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

5 years ago

1.0.19

5 years ago

1.0.18

5 years ago

1.0.17

5 years ago

1.0.16

5 years ago

1.0.15

5 years ago

1.0.14

5 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.4

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago