Socket
Socket
Sign inDemoInstall

graphql-door-client

Package Overview
Dependencies
18
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    graphql-door-client

This helps to create a client point to fetch data from backend is built with [GraphQLDoorNet](https://github.com/hieutran3010/GraphQLDoorNet)


Version published
Weekly downloads
1
Maintainers
1
Created
Weekly downloads
 

Readme

Source

odl-graphql-client

This helps to create a client point to fetch data from backend is built with GraphQLDoorNet

Installation

Use npm to install

npm install --save odl-graphql-client

Use yarn to install

yarn add odl-graphql-client

Usage

import GraphQLDoorClient from 'graphql-door-client';
import {GraphQLDoorClientOptions} from 'graphql-door-client/types'

constructor() {
    const endpoint = '<your-graphql-server>';
    const options : GraphQLDoorClientOptions = {authenticationToken: '<your-authentication-token>', headers: "<your-custom-header-key-value>"};
    this.graphqlFetcher = new GraphQLDoorClient(endpoint, options); // options is optional
}

Methods

All methods are served with asynchronous.

Method NameDescriptionParams
queryManyAsyncSupport to query many record on an entityentityName: string, queryParams: QueryParams, selectFields?: string[] - optional
queryOneAsyncSupport to query one record on an entityentityName: string, queryParams: QueryParams, selectFields?: string[] - optional
getByIdAsyncSupport to get a record by id on an entityentityName: string, id: string, selectFields?: string[] - optional
countAsyncSupport to count based on a query on an entityentityName: string, query: string
addAsyncSupport to add a new record into an entity and return the new recordentityName: string, model: any, selectFields?: string[] - optional
updateAsyncSupport to update a record in an entity and return the updated recordentityName: string, id: string, model: any, selectFields?: string[] - optional
deleteAsyncSupport to delete a record in an entityentityName: string, id: string

Types

QueryParams

PropertyTypeDescription
query?stringthe linq query. Please get the further information at https://github.com/StefH/System.Linq.Dynamic.Core
include?stringThe nested entity which you want to include. You can include many entities with ','
orderBy?stringThe property which you want to order by, default is ASC, for contrary, just add "desc" after the prop name. Example: {orderBy: 'name desc'}
page?number
pageSize?number

Keywords

FAQs

Last updated on 10 Jan 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc