gql-payload
Advanced tools
Comparing version 2.0.0 to 2.1.0
@@ -1,2 +0,2 @@ | ||
interface Variables { | ||
interface VariablesProps { | ||
type?: string; | ||
@@ -9,5 +9,5 @@ name?: string; | ||
type VariableOptions = Variables | { [k: string]: any }; | ||
type VariablesOption = { [k: string]: VariablesProps } | { [k: string]: any }; | ||
interface IOperation { | ||
interface OperationOption { | ||
name: string; | ||
@@ -17,9 +17,9 @@ alias: string; | ||
interface Fields extends Array<string | object | NestedOptions> {} | ||
interface FieldsOption extends Array<string | object | NestedOptions> {} | ||
interface IQueryBuilderOptions { | ||
operation: string | IOperation /* Operation name */; | ||
fields?: Fields /* Selection of fields to be returned by the operation */; | ||
variables?: VariableOptions; | ||
/* VariableOptions Interface or regular single key object */ | ||
interface GqlPayloadOptions { | ||
operation: string | OperationOption /* Operation name */; | ||
fields?: FieldsOption /* Selection of fields to be returned by the operation */; | ||
variables?: VariablesOption; | ||
/* VariablesOption Interface or regular single key object */ | ||
} | ||
@@ -29,4 +29,4 @@ | ||
operation: string; | ||
variables: IQueryBuilderOptions[]; | ||
fields: Fields; | ||
variables: VariablesOption; | ||
fields: FieldsOption; | ||
inlineFragment?: boolean | null; | ||
@@ -36,11 +36,13 @@ namedFragment?: boolean | null; | ||
type FragmentFields = Array<string | { [key: string]: FragmentFields }>; | ||
type FragmentFields = string | { [key: string]: string[] }; | ||
interface Config { | ||
interface FragmentsConfig { | ||
name: string; | ||
on: string; | ||
fields: FragmentFields[]; | ||
} | ||
interface GqlPayloadConfig { | ||
operationName?: string; | ||
fragments?: { | ||
name: string; | ||
on: string; | ||
fields: FragmentFields; | ||
}[]; | ||
fragments?: FragmentsConfig[]; | ||
} | ||
@@ -50,3 +52,3 @@ | ||
mutationBuilder: () => { variables: any, query: string }; | ||
mutationsBuilder: (options: IQueryBuilderOptions[]) => { | ||
mutationsBuilder: (options: GqlPayloadOptions[]) => { | ||
variables: any; | ||
@@ -59,3 +61,3 @@ query: string; | ||
queryBuilder: () => { variables: any, query: string }; | ||
queriesBuilder: (options: IQueryBuilderOptions[]) => { | ||
queriesBuilder: (options: GqlPayloadOptions[]) => { | ||
variables: any; | ||
@@ -68,3 +70,3 @@ query: string; | ||
subscriptionBuilder: () => { variables: any, query: string }; | ||
subscriptionsBuilder: (options: IQueryBuilderOptions[]) => { | ||
subscriptionsBuilder: (options: GqlPayloadOptions[]) => { | ||
variables: any; | ||
@@ -79,5 +81,5 @@ query: string; | ||
private operation; | ||
constructor(options: IQueryBuilderOptions | IQueryBuilderOptions[]); | ||
constructor(options: GqlPayloadOptions | GqlPayloadOptions[]); | ||
mutationBuilder(): any; | ||
mutationsBuilder(mutations: IQueryBuilderOptions[]): any; | ||
mutationsBuilder(mutations: GqlPayloadOptions[]): any; | ||
private queryDataNameAndArgumentMap; | ||
@@ -94,3 +96,3 @@ private queryDataArgumentAndTypeMap; | ||
private operation; | ||
constructor(options: IQueryBuilderOptions | IQueryBuilderOptions[]); | ||
constructor(options: GqlPayloadOptions | GqlPayloadOptions[]); | ||
queryBuilder(): { | ||
@@ -102,3 +104,3 @@ variables: { | ||
}; | ||
queriesBuilder(queries: IQueryBuilderOptions[]): { | ||
queriesBuilder(queries: GqlPayloadOptions[]): { | ||
variables: { | ||
@@ -118,11 +120,11 @@ [p: string]: unknown; | ||
declare const DefaultAppSyncMutationAdapter: typeof DefaultAppSyncMutationAdapter$1; | ||
declare const gqlQuery: (options: IQueryBuilderOptions | IQueryBuilderOptions[], config?: Config | null, adapter?: any) => { | ||
declare const gqlQuery: (options: GqlPayloadOptions | GqlPayloadOptions[], config?: GqlPayloadConfig | null, adapter?: any) => { | ||
variables: any; | ||
query: string; | ||
}; | ||
declare const gqlMutation: (options: IQueryBuilderOptions | IQueryBuilderOptions[], config?: Config | null, adapter?: IMutationAdapter) => { | ||
declare const gqlMutation: (options: GqlPayloadOptions | GqlPayloadOptions[], config?: GqlPayloadConfig | null, adapter?: IMutationAdapter) => { | ||
variables: any; | ||
query: string; | ||
}; | ||
declare const gqlSubscription: (options: IQueryBuilderOptions | IQueryBuilderOptions[], config?: Config | null, adapter?: ISubscriptionAdapter) => { | ||
declare const gqlSubscription: (options: GqlPayloadOptions | GqlPayloadOptions[], config?: GqlPayloadConfig | null, adapter?: ISubscriptionAdapter) => { | ||
variables: any; | ||
@@ -132,2 +134,2 @@ query: string; | ||
export { DefaultAppSyncMutationAdapter, DefaultAppSyncQueryAdapter, gqlMutation, gqlQuery, gqlSubscription }; | ||
export { DefaultAppSyncMutationAdapter, DefaultAppSyncQueryAdapter, type FieldsOption, type FragmentFields, type FragmentsConfig, type GqlPayloadConfig, type GqlPayloadOptions, type NestedOptions, type OperationOption, type VariablesOption, type VariablesProps, gqlMutation, gqlQuery, gqlSubscription }; |
{ | ||
"name": "gql-payload", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"description": "GraphQL Payload Builder", | ||
@@ -37,10 +37,11 @@ "type": "module", | ||
"@types/jest": "^29.5.12", | ||
"@types/node": "^22.5.0", | ||
"@typescript-eslint/parser": "^8.2.0", | ||
"@types/node": "^22.5.1", | ||
"@typescript-eslint/parser": "^8.3.0", | ||
"changelogen": "^0.5.5", | ||
"eslint": "^9.9.0", | ||
"eslint": "^9.9.1", | ||
"jest": "29.7.0", | ||
"shx": "^0.3.4", | ||
"ts-jest": "^29.2.4", | ||
"ts-jest": "^29.2.5", | ||
"tsup": "^8.2.4", | ||
"tsx": "^4.19.0", | ||
"typescript": "^5.5.4" | ||
@@ -52,8 +53,9 @@ }, | ||
"scripts": { | ||
"build": "shx rm -rf ./dist/* && tsup src/index.ts --format esm --dts --config tsconfig.json", | ||
"build": "shx rm -rf ./dist/* && tsup-node src/index.ts --format esm --dts --config tsconfig.json", | ||
"lint": "eslint --config .config/eslint.mjs", | ||
"test": "jest --config", | ||
"playground": "node playground/index.js", | ||
"playground:ts": "tsx playground/index.ts", | ||
"release": "changelogen --release" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
44068
690
12