graphql-tools
Advanced tools
Comparing version 0.8.4 to 0.9.0
@@ -7,2 +7,6 @@ # Change log | ||
### v0.9.0 | ||
* Migrate from `typed-graphql` to `@types/graphql`. [PR #249](https://github.com/apollostack/graphql-tools/pull/249) | ||
### v0.8.4 | ||
@@ -9,0 +13,0 @@ |
@@ -1,4 +0,4 @@ | ||
/// <reference types="typed-graphql" /> | ||
/// <reference types="graphql" /> | ||
import { GraphQLSchema } from 'graphql'; | ||
import { PubSub } from 'graphql-subscriptions'; | ||
export declare function autopublishMutationResults(schema: GraphQLSchema, pubsub: PubSub): void; |
@@ -1,3 +0,3 @@ | ||
/// <reference types="typed-graphql" /> | ||
import { GraphQLSchema, GraphQLFieldDefinition, GraphQLResult, GraphQLType, GraphQLFieldResolveFn, GraphQLIsTypeOfFn, GraphQLTypeResolveFn, GraphQLScalarType } from 'graphql'; | ||
/// <reference types="graphql" /> | ||
import { GraphQLSchema, GraphQLField, ExecutionResult, GraphQLType, GraphQLFieldResolver, GraphQLIsTypeOfFn, GraphQLTypeResolver, GraphQLScalarType } from 'graphql'; | ||
export interface IResolverValidationOptions { | ||
@@ -9,5 +9,5 @@ requireResolversForArgs?: boolean; | ||
export interface IResolverOptions { | ||
resolve?: GraphQLFieldResolveFn; | ||
__resolveType?: GraphQLTypeResolveFn; | ||
__isTypeOf?: GraphQLIsTypeOfFn; | ||
resolve?: GraphQLFieldResolver<any, any>; | ||
__resolveType?: GraphQLTypeResolver<any, any>; | ||
__isTypeOf?: GraphQLIsTypeOfFn<any, any>; | ||
} | ||
@@ -17,3 +17,3 @@ export declare type ITypedef = (() => ITypedef[]) | string; | ||
export declare type IResolverObject = { | ||
[key: string]: GraphQLFieldResolveFn | IResolverOptions; | ||
[key: string]: GraphQLFieldResolver<any, any> | IResolverOptions; | ||
}; | ||
@@ -42,8 +42,8 @@ export interface IResolvers { | ||
} | ||
export declare type IFieldIteratorFn = (fieldDef: GraphQLFieldDefinition, typeName: string, fieldName: string) => void; | ||
export declare type IMockFn = GraphQLFieldResolveFn; | ||
export declare type IFieldIteratorFn = (fieldDef: GraphQLField<any, any>, typeName: string, fieldName: string) => void; | ||
export declare type IMockFn = GraphQLFieldResolver<any, any>; | ||
export declare type IMocks = { | ||
[key: string]: IMockFn; | ||
}; | ||
export declare type IMockTypeFn = (type: GraphQLType, typeName?: string, fieldName?: string) => GraphQLFieldResolveFn; | ||
export declare type IMockTypeFn = (type: GraphQLType, typeName?: string, fieldName?: string) => GraphQLFieldResolver<any, any>; | ||
export interface IMockOptions { | ||
@@ -57,3 +57,3 @@ schema: GraphQLSchema; | ||
[key: string]: any; | ||
}) => Promise<GraphQLResult>; | ||
}) => Promise<ExecutionResult>; | ||
} |
@@ -1,3 +0,3 @@ | ||
/// <reference types="typed-graphql" /> | ||
import { GraphQLSchema, GraphQLList, GraphQLResolveInfo, GraphQLFieldResolveFn } from 'graphql'; | ||
/// <reference types="graphql" /> | ||
import { GraphQLSchema, GraphQLList, GraphQLResolveInfo, GraphQLFieldResolver } from 'graphql'; | ||
import { IMocks, IMockServer, IMockOptions, IMockTypeFn, ITypeDefinitions } from './Interfaces'; | ||
@@ -9,8 +9,8 @@ declare function mockServer(schema: GraphQLSchema | ITypeDefinitions, mocks: IMocks, preserveResolvers?: boolean): IMockServer; | ||
private wrappedFunction; | ||
constructor(len: number | number[], wrappedFunction?: GraphQLFieldResolveFn); | ||
constructor(len: number | number[], wrappedFunction?: GraphQLFieldResolver<any, any>); | ||
mock(root: any, args: { | ||
[key: string]: any; | ||
}, context: any, info: GraphQLResolveInfo, fieldType: GraphQLList, mockTypeFunc: IMockTypeFn): any[]; | ||
}, context: any, info: GraphQLResolveInfo, fieldType: GraphQLList<any>, mockTypeFunc: IMockTypeFn): any[]; | ||
private randint(low, high); | ||
} | ||
export { addMockFunctionsToSchema, MockList, mockServer }; |
@@ -192,3 +192,3 @@ "use strict"; | ||
// because no resolver is called at the root. | ||
/* istanbul ignore next: Must provide schema definition with query type or a type named Query. */ | ||
/* istanbul ignore next: Must provide schema DefinitionNode with query type or a type named Query. */ | ||
var isOnQueryType = schema.getQueryType() ? (schema.getQueryType().name === typeName) : false; | ||
@@ -195,0 +195,0 @@ var isOnMutationType = schema.getMutationType() ? (schema.getMutationType().name === typeName) : false; |
@@ -1,3 +0,3 @@ | ||
/// <reference types="typed-graphql" /> | ||
import { GraphQLSchema, GraphQLResolveInfo, GraphQLFieldResolveFn } from 'graphql'; | ||
/// <reference types="graphql" /> | ||
import { GraphQLSchema, GraphQLResolveInfo, GraphQLFieldResolver } from 'graphql'; | ||
import { IExecutableSchemaDefinition, ILogger, IResolvers, ITypeDefinitions, IFieldIteratorFn, IResolverValidationOptions } from './Interfaces'; | ||
@@ -12,7 +12,7 @@ declare class SchemaError extends Error { | ||
declare const attachConnectorsToContext: Function; | ||
declare function addSchemaLevelResolveFunction(schema: GraphQLSchema, fn: GraphQLFieldResolveFn): void; | ||
declare function addSchemaLevelResolveFunction(schema: GraphQLSchema, fn: GraphQLFieldResolver<any, any>): void; | ||
declare function addResolveFunctionsToSchema(schema: GraphQLSchema, resolveFunctions: IResolvers): void; | ||
declare function assertResolveFunctionsPresent(schema: GraphQLSchema, resolverValidationOptions?: IResolverValidationOptions): void; | ||
declare function addErrorLoggingToSchema(schema: GraphQLSchema, logger: ILogger): void; | ||
declare function chainResolvers(resolvers: GraphQLFieldResolveFn[]): (root: any, args: { | ||
declare function chainResolvers(resolvers: GraphQLFieldResolver<any, any>[]): (root: any, args: { | ||
[argName: string]: any; | ||
@@ -19,0 +19,0 @@ }, ctx: any, info: GraphQLResolveInfo) => any; |
{ | ||
"name": "graphql-tools", | ||
"version": "0.8.4", | ||
"version": "0.9.0", | ||
"description": "A set of useful tools for GraphQL", | ||
@@ -58,3 +58,3 @@ "main": "dist/index.js", | ||
"optionalDependencies": { | ||
"typed-graphql": "^1.0.2" | ||
"@types/graphql": "^0.8.5" | ||
}, | ||
@@ -78,3 +78,3 @@ "devDependencies": { | ||
"mocha": "^3.0.1", | ||
"remap-istanbul": "^0.8.0", | ||
"remap-istanbul": "0.8.0", | ||
"request": "^2.72.0", | ||
@@ -81,0 +81,0 @@ "request-promise": "^4.1.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
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
78790