1.1.73 • Published 1 year ago

@foodexplorer/graph-client v1.1.73

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

FoodExplorer Graph Client (JS)

Quick Overview

This is a cross-platform (node.js, browser) GraphQL-Client for FoodExplorer.

Setup

Installation

If you haven't configured npm for private foodexplorer access, please login to your NPM user account with

npm login
# You will be prompted to provide username & password

Then install the package

npm install --save @foodexplorer/graph-client

Query structure

// @foodexplorer/graph-client/lib/{platform}/{queryType}/{object...}/{method}

// Examples
import { create as createOrderSend } from '@foodexplorer/graph-client/lib/sap/mutation/order-send/create';
import { findUpdated as findUpdatedCustomers } from '@foodexplorer/graph-client/lib/fecommerce/query/customers/find-updated';

Usage

import { GraphClient } from '@foodexplorer/graph-client';
import { find as findCases } from '@foodexplorer/graph-client/lib/salesforce/query/cases/find';

const client = new GraphClient('key', 'secret');

// to use Staging environment:
client.graphUrl = 'stage';

// to use Production environment (https://graph.foodexplorer.io):
client.graphUrl = 'prod';

// to use a custom environment:
client.graphUrl = 'http://localhost:8000';


// All queries and mutations can be executed like this

async function myHandler () {
    try {
        const response = await findCases(client, {
            from: '201801010000',
            until: '201801020000'
        });

        console.log(response.data);
    }

    catch (e) {
        console.log(`Error`);
        console.log(e);
    }
}

myHandler();

Development

Watch task for local development

npm start

Fetch task for graphql schema fetch (using localhost connection settings) (see helpers/fragment-types.js)

npm run fetch-schema

Build task for graphql type generation and npm publish preparation

npm run build

If you would like to publish a new version, please increase version number in package.json and run

npm publish

Features

  • typescript: transpiling from .ts to ES5
  • live compiling: as well as live reload
1.1.73

1 year ago

1.1.72

3 years ago

1.1.71

4 years ago

1.1.70

4 years ago

1.1.69

4 years ago

1.1.68

4 years ago

1.1.67

4 years ago

1.1.66

4 years ago

1.1.65

4 years ago

1.1.64

4 years ago

1.1.63

4 years ago

1.1.62

4 years ago

1.1.61

4 years ago

1.1.60

4 years ago

1.1.59

5 years ago

1.1.58

5 years ago

1.1.57

5 years ago

1.1.56

5 years ago

1.1.55

5 years ago

1.1.54

5 years ago

1.1.53

5 years ago

1.1.52

5 years ago

1.1.51

5 years ago

1.1.50

5 years ago

1.1.49

5 years ago

1.1.48

5 years ago

1.1.47

5 years ago

1.1.46

5 years ago

1.1.45

5 years ago

1.1.44

5 years ago

1.1.43

5 years ago

1.1.42

5 years ago

1.1.40

5 years ago

1.1.39

5 years ago

1.1.38

5 years ago

1.1.37

5 years ago

1.1.36

5 years ago

1.1.35

5 years ago

1.1.34

5 years ago

1.1.33

5 years ago

1.1.32

5 years ago

1.1.31

5 years ago

1.1.30

5 years ago

1.1.29

5 years ago

1.1.28

5 years ago

1.1.27

5 years ago

1.1.26

5 years ago

1.1.25

5 years ago

1.1.24

5 years ago

1.1.23

5 years ago

1.1.22

5 years ago

1.1.21

5 years ago

1.1.20

5 years ago

1.1.19

5 years ago

1.1.18

5 years ago

1.1.17

5 years ago

1.1.16

5 years ago

1.1.15

5 years ago

1.1.14

5 years ago

1.1.13

5 years ago

1.1.12

5 years ago

1.1.11

5 years ago

1.1.10

5 years ago

1.1.9

5 years ago

1.1.8

5 years ago

1.1.7

5 years ago

1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

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.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago