1.1.73 • Published 3 years ago

@foodexplorer/graph-client v1.1.73

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years 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

3 years ago

1.1.72

5 years ago

1.1.71

5 years ago

1.1.70

5 years ago

1.1.69

6 years ago

1.1.68

6 years ago

1.1.67

6 years ago

1.1.66

6 years ago

1.1.65

6 years ago

1.1.64

6 years ago

1.1.63

6 years ago

1.1.62

6 years ago

1.1.61

6 years ago

1.1.60

6 years ago

1.1.59

6 years ago

1.1.58

6 years ago

1.1.57

6 years ago

1.1.56

6 years ago

1.1.55

6 years ago

1.1.54

6 years ago

1.1.53

6 years ago

1.1.52

6 years ago

1.1.51

6 years ago

1.1.50

6 years ago

1.1.49

6 years ago

1.1.48

6 years ago

1.1.47

6 years ago

1.1.46

6 years ago

1.1.45

6 years ago

1.1.44

6 years ago

1.1.43

6 years ago

1.1.42

6 years ago

1.1.40

6 years ago

1.1.39

6 years ago

1.1.38

6 years ago

1.1.37

6 years ago

1.1.36

6 years ago

1.1.35

6 years ago

1.1.34

6 years ago

1.1.33

6 years ago

1.1.32

6 years ago

1.1.31

6 years ago

1.1.30

6 years ago

1.1.29

6 years ago

1.1.28

6 years ago

1.1.27

7 years ago

1.1.26

7 years ago

1.1.25

7 years ago

1.1.24

7 years ago

1.1.23

7 years ago

1.1.22

7 years ago

1.1.21

7 years ago

1.1.20

7 years ago

1.1.19

7 years ago

1.1.18

7 years ago

1.1.17

7 years ago

1.1.16

7 years ago

1.1.15

7 years ago

1.1.14

7 years ago

1.1.13

7 years ago

1.1.12

7 years ago

1.1.11

7 years ago

1.1.10

7 years ago

1.1.9

7 years ago

1.1.8

7 years ago

1.1.7

7 years ago

1.1.6

7 years ago

1.1.5

7 years ago

1.1.4

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.13

7 years ago

1.0.12

7 years ago

1.0.11

7 years ago

1.0.10

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago