@graphitation/supermassive
Advanced tools
Comparing version 0.4.5 to 0.5.0
@@ -5,3 +5,18 @@ { | ||
{ | ||
"date": "Fri, 14 Jan 2022 11:15:11 GMT", | ||
"date": "Tue, 18 Jan 2022 09:59:46 GMT", | ||
"tag": "@graphitation/supermassive_v0.5.0", | ||
"version": "0.5.0", | ||
"comments": { | ||
"minor": [ | ||
{ | ||
"author": "jakubvejr@microsoft.com", | ||
"package": "@graphitation/supermassive", | ||
"commit": "6a2790e55986f1ae77c6abacdc7e7b81255c68f2", | ||
"comment": "Added support for subscribe operation" | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"date": "Fri, 14 Jan 2022 11:15:34 GMT", | ||
"tag": "@graphitation/supermassive_v0.4.5", | ||
@@ -8,0 +23,0 @@ "version": "0.4.5", |
# Change Log - @graphitation/supermassive | ||
This log was last generated on Fri, 14 Jan 2022 11:15:11 GMT and should not be manually modified. | ||
This log was last generated on Tue, 18 Jan 2022 09:59:46 GMT and should not be manually modified. | ||
<!-- Start content --> | ||
## 0.5.0 | ||
Tue, 18 Jan 2022 09:59:46 GMT | ||
### Minor changes | ||
- Added support for subscribe operation (jakubvejr@microsoft.com) | ||
## 0.4.5 | ||
Fri, 14 Jan 2022 11:15:11 GMT | ||
Fri, 14 Jan 2022 11:15:34 GMT | ||
@@ -11,0 +19,0 @@ ### Patches |
@@ -0,3 +1,7 @@ | ||
var __create = Object.create; | ||
var __defProp = Object.defineProperty; | ||
var __getProtoOf = Object.getPrototypeOf; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropSymbols = Object.getOwnPropertySymbols; | ||
@@ -22,2 +26,33 @@ var __propIsEnum = Object.prototype.propertyIsEnumerable; | ||
}; | ||
var __reExport = (target, module2, desc) => { | ||
if (module2 && typeof module2 === "object" || typeof module2 === "function") { | ||
for (let key of __getOwnPropNames(module2)) | ||
if (!__hasOwnProp.call(target, key) && key !== "default") | ||
__defProp(target, key, {get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable}); | ||
} | ||
return target; | ||
}; | ||
var __toModule = (module2) => { | ||
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? {get: () => module2.default, enumerable: true} : {value: module2, enumerable: true})), module2); | ||
}; | ||
var __async = (__this, __arguments, generator) => { | ||
return new Promise((resolve, reject) => { | ||
var fulfilled = (value) => { | ||
try { | ||
step(generator.next(value)); | ||
} catch (e) { | ||
reject(e); | ||
} | ||
}; | ||
var rejected = (value) => { | ||
try { | ||
step(generator.throw(value)); | ||
} catch (e) { | ||
reject(e); | ||
} | ||
}; | ||
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected); | ||
step((generator = generator.apply(__this, __arguments)).next()); | ||
}); | ||
}; | ||
__markAsModule(exports); | ||
@@ -27,2 +62,3 @@ __export(exports, { | ||
}); | ||
var import_iterall = __toModule(require("iterall")); | ||
const films = (parent, args, {models}) => { | ||
@@ -90,2 +126,17 @@ return models.getData("/films").filter(({id}) => parent.films.includes(id)); | ||
}; | ||
const emitPersons = function(_0, _1, _2) { | ||
return __async(this, arguments, function* (parent, {limit, throwError}, {models}) { | ||
if (throwError) { | ||
throw new Error("error"); | ||
return; | ||
} | ||
const persons = yield models.getData("/people"); | ||
const personsLimit = Math.min(limit, persons.length); | ||
const output = {length: personsLimit}; | ||
for (let i = 0; i < personsLimit; i++) { | ||
output[i] = {emitPersons: persons[i]}; | ||
} | ||
return (0, import_iterall.createAsyncIterator)(output); | ||
}); | ||
}; | ||
const searchTransportsByName = (parent, {search}, {models}) => { | ||
@@ -100,2 +151,7 @@ return models.getData("/transport").filter((transport2) => new RegExp(search, "i").test(transport2.name)); | ||
}, | ||
Subscription: { | ||
emitPersons: { | ||
subscribe: emitPersons | ||
} | ||
}, | ||
Query: { | ||
@@ -102,0 +158,0 @@ search(parent, {search}, {models}, info) { |
import { GraphQLError } from "graphql"; | ||
import { DocumentNode, FieldNode, FragmentDefinitionNode, OperationDefinitionNode, TypeNode } from "./ast/TypedAST"; | ||
import { DocumentNode, FieldNode, FragmentDefinitionNode, OperationDefinitionNode, OperationTypeDefinitionNode, TypeNode } from "./ast/TypedAST"; | ||
import type { Maybe } from "./jsutils/Maybe"; | ||
@@ -7,3 +7,3 @@ import type { ObjMap } from "./jsutils/ObjMap"; | ||
import type { PromiseOrValue } from "./jsutils/PromiseOrValue"; | ||
import { ExecutionWithoutSchemaArgs, FieldResolver, ResolveInfo, Resolvers, TypeResolver, ExecutionResult } from "./types"; | ||
import { ExecutionWithoutSchemaArgs, FunctionFieldResolver, ResolveInfo, Resolvers, TypeResolver, ExecutionResult } from "./types"; | ||
/** | ||
@@ -43,3 +43,3 @@ * Terminology | ||
}; | ||
fieldResolver: FieldResolver<any, any>; | ||
fieldResolver: FunctionFieldResolver<any, any>; | ||
typeResolver: TypeResolver<any, any>; | ||
@@ -78,3 +78,3 @@ errors: Array<GraphQLError>; | ||
[variable: string]: unknown; | ||
}>, operationName: Maybe<string>, fieldResolver: Maybe<FieldResolver<unknown, unknown>>, typeResolver?: Maybe<TypeResolver<unknown, unknown>>): Array<GraphQLError> | ExecutionContext; | ||
}>, operationName: Maybe<string>, fieldResolver: Maybe<FunctionFieldResolver<unknown, unknown>>, typeResolver?: Maybe<TypeResolver<unknown, unknown>>): Array<GraphQLError> | ExecutionContext; | ||
/** | ||
@@ -101,3 +101,4 @@ * @internal | ||
*/ | ||
export declare const defaultFieldResolver: FieldResolver<unknown, unknown>; | ||
export declare const defaultFieldResolver: FunctionFieldResolver<unknown, unknown>; | ||
export declare function getOperationRootTypeName(operation: OperationDefinitionNode | OperationTypeDefinitionNode): string; | ||
//# sourceMappingURL=executeWithoutSchema.d.ts.map |
@@ -30,3 +30,4 @@ var __create = Object.create; | ||
defaultTypeResolver: () => defaultTypeResolver, | ||
executeWithoutSchema: () => executeWithoutSchema | ||
executeWithoutSchema: () => executeWithoutSchema, | ||
getOperationRootTypeName: () => getOperationRootTypeName | ||
}); | ||
@@ -195,2 +196,5 @@ var import_graphql = __toModule(require("graphql")); | ||
resolveFn = typeResolvers == null ? void 0 : typeResolvers[fieldName]; | ||
if (typeof resolveFn !== "function" && resolveFn != null) { | ||
resolveFn = resolveFn.resolve; | ||
} | ||
} | ||
@@ -197,0 +201,0 @@ if (!resolveFn) { |
export { executeWithoutSchema } from "./executeWithoutSchema"; | ||
export { executeWithSchema } from "./executeWithSchema"; | ||
export { subscribeWithSchema } from "./subscribeWithSchema"; | ||
export { subscribeWithoutSchema } from "./subscribeWithoutSchema"; | ||
export type { Resolvers } from "./types"; | ||
@@ -8,2 +10,3 @@ export { addTypesToRequestDocument } from "./ast/addTypesToRequestDocument"; | ||
export { annotateDocumentGraphQLTransform } from "./transforms/annotateDocumentGraphQLTransform"; | ||
export { DocumentNode } from "./ast/TypedAST"; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -25,2 +25,3 @@ var __create = Object.create; | ||
__export(exports, { | ||
DocumentNode: () => import_TypedAST.DocumentNode, | ||
addTypesToRequestDocument: () => import_addTypesToRequestDocument.addTypesToRequestDocument, | ||
@@ -31,6 +32,10 @@ annotateDocumentGraphQLTransform: () => import_annotateDocumentGraphQLTransform.annotateDocumentGraphQLTransform, | ||
extractImplicitTypes: () => import_extractImplicitTypesRuntime.extractImplicitTypes, | ||
specifiedScalars: () => import_values.specifiedScalars | ||
specifiedScalars: () => import_values.specifiedScalars, | ||
subscribeWithSchema: () => import_subscribeWithSchema.subscribeWithSchema, | ||
subscribeWithoutSchema: () => import_subscribeWithoutSchema.subscribeWithoutSchema | ||
}); | ||
var import_executeWithoutSchema = __toModule(require("./executeWithoutSchema")); | ||
var import_executeWithSchema = __toModule(require("./executeWithSchema")); | ||
var import_subscribeWithSchema = __toModule(require("./subscribeWithSchema")); | ||
var import_subscribeWithoutSchema = __toModule(require("./subscribeWithoutSchema")); | ||
var import_addTypesToRequestDocument = __toModule(require("./ast/addTypesToRequestDocument")); | ||
@@ -40,1 +45,2 @@ var import_extractImplicitTypesRuntime = __toModule(require("./extractImplicitTypesRuntime")); | ||
var import_annotateDocumentGraphQLTransform = __toModule(require("./transforms/annotateDocumentGraphQLTransform")); | ||
var import_TypedAST = __toModule(require("./ast/TypedAST")); |
@@ -9,3 +9,7 @@ import { GraphQLEnumType, GraphQLError, GraphQLFormattedError, GraphQLInputObjectType, GraphQLScalarType, DocumentNode as UntypedDocumentNode } from "graphql"; | ||
export declare type EnumTypeResolver = GraphQLEnumType; | ||
export declare type FieldResolver<TSource, TContext, TArgs = Record<string, any>, TReturn = any> = (source: TSource, args: TArgs, context: TContext, info: ResolveInfo) => TReturn; | ||
export declare type FunctionFieldResolver<TSource, TContext, TArgs = Record<string, any>, TReturn = any> = (source: TSource, args: TArgs, context: TContext, info: ResolveInfo) => TReturn; | ||
export declare type FieldResolver<TSource, TContext, TArgs = Record<string, any>, TReturn = any> = FunctionFieldResolver<TSource, TContext, TArgs, TReturn> | { | ||
subscribe?: FunctionFieldResolver<TSource, TContext, TArgs, TReturn>; | ||
resolve?: FunctionFieldResolver<TSource, TContext, TArgs, TReturn>; | ||
}; | ||
export declare type TypeResolver<TSource, TContext> = (value: TSource, context: TContext, info: ResolveInfo) => PromiseOrValue<Maybe<string>>; | ||
@@ -65,4 +69,5 @@ export declare type ObjectTypeResolver<TSource = any, TContext = any, TArgs = any> = { | ||
operationName?: Maybe<string>; | ||
fieldResolver?: Maybe<FieldResolver<any, any>>; | ||
fieldResolver?: Maybe<FunctionFieldResolver<any, any>>; | ||
typeResolver?: Maybe<TypeResolver<any, any>>; | ||
subscribeFieldResolver?: Maybe<FunctionFieldResolver<any, any>>; | ||
} | ||
@@ -69,0 +74,0 @@ export declare type ExecutionWithoutSchemaArgs = CommonExecutionArgs & { |
{ | ||
"name": "@graphitation/supermassive", | ||
"license": "MIT", | ||
"version": "0.4.5", | ||
"version": "0.5.0", | ||
"bin": { | ||
@@ -30,2 +30,3 @@ "supermassive": "./bin/supermassive.js" | ||
"graphql-jit": "^0.5.1", | ||
"iterall": "^1.3.0", | ||
"monorepo-scripts": "*", | ||
@@ -32,0 +33,0 @@ "node-json-db": "^1.3.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
322625
197
6558
11