graphql-knifey
TypeScript icon, indicating that this package has built-in type declarations

2.4.2 • Public • Published

GraphQL Project Knifey

Reuse code for generic graphql projects.

Usage

import diContainer, { apolloContextLDEGen, apolloServerLDEGen, appConfigLDEGen } from 'graphql-knifey';

// create you injection dict
const myInjectionDict = {
  // map config from env
  apolloContext: apolloContextLDEGen({
    userService: 'userService',
    tokenAuthService: 'tokenAuthService',
  }),
  apolloServer: apolloServerLDEGen(resolvers, graphqlSchema),
  aService: aServiceLoadDictElement,
  // ... can override graphql-knifey entries
};

// pass it to graphql-knifey's default one
diContainer.addToLoadDict(myInjectionDict);

Customize/Augment appConfig

import diContainer, { appConfigLDEGen, mergeToDefaultAppConfigMap } from 'graphql-knifey';
import localAppConfigMap from '../config/appConfig';

// create you injection dict
const myInjectionDict = {
  // override defaultAppConfig with a merge between defaultAppConfigMap and your localAppConfigMap
  appConfig: appConfigLDEGen(mergeToDefaultAppConfigMap(localAppConfigMap)),
  // ... rest of entres as in previous example
};

// pass it to graphql-knifey's default one
diContainer.addToLoadDict(myInjectionDict);

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
2.4.265latest

Version History

VersionDownloads (Last 7 Days)Published
2.4.265
2.4.147
2.4.050
2.3.153
2.3.066
2.2.65
2.2.53
2.2.42
2.2.32
2.2.22
2.2.13
2.2.02
2.1.13
2.1.02
2.0.282
2.0.273
2.0.263
2.0.252
2.0.243
2.0.233
2.0.223
2.0.213
1.0.203
1.0.192
1.0.182
1.0.172
1.0.163
1.0.153
1.0.143
1.0.133
1.0.122
1.0.112
1.0.103
1.0.93
1.0.83
1.0.73
1.0.63
1.0.53
1.0.42
1.0.33
1.0.22
1.0.13
1.0.03

Package Sidebar

Install

npm i graphql-knifey

Weekly Downloads

383

Version

2.4.2

License

ISC

Unpacked Size

107 kB

Total Files

107

Last publish

Collaborators

  • guillermo_at