Skip to content

Commit

Permalink
fix: graphql v16 type shenanigans
Browse files Browse the repository at this point in the history
  • Loading branch information
dchambers committed May 9, 2022
1 parent a8cad77 commit 19acc6e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,8 @@ export class GraphQLInstrumentation extends InstrumentationBase {
schema: graphqlTypes.GraphQLSchema,
documentAST: graphqlTypes.DocumentNode,
rules?: ReadonlyArray<graphqlTypes.ValidationRule>,
typeInfo?: graphqlTypes.TypeInfo,
options?: { maxErrors?: number }
options?: { maxErrors?: number },
typeInfo?: graphqlTypes.TypeInfo
): ReadonlyArray<graphqlTypes.GraphQLError> {
return instrumentation._validate(
this,
Expand Down Expand Up @@ -373,8 +373,8 @@ export class GraphQLInstrumentation extends InstrumentationBase {
schema,
documentAST,
rules,
typeInfo,
options
options,
typeInfo
);
},
(err, errors) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ export type validateType = (
schema: graphqlTypes.GraphQLSchema,
documentAST: graphqlTypes.DocumentNode,
rules?: ReadonlyArray<graphqlTypes.ValidationRule>,
options?: { maxErrors?: number },
typeInfo?: graphqlTypes.TypeInfo,
options?: { maxErrors?: number }
) => ReadonlyArray<graphqlTypes.GraphQLError>;

export interface GraphQLField {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ export function wrapFieldResolver<TSource = any, TContext = any, TArgs = any>(
>
>(
() => {
return fieldResolver.call(this, source, args, contextValue, info);
return fieldResolver.call(this, source, args, contextValue, info) as any;
},
err => {
if (shouldEndSpan) {
Expand Down Expand Up @@ -421,7 +421,7 @@ async function safeExecuteInTheMiddleAsync<T>(
try {
result = await execute();
} catch (e) {
error = e;
error = e as Error;
} finally {
onFinish(error, result);
if (error && !preventThrowingError) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1043,7 +1043,7 @@ describe('graphql', () => {

describe('responseHook', () => {
let spans: ReadableSpan[];
let graphqlResult: graphqlTypes.ExecutionResult;
let graphqlResult: graphqlTypes.ExecutionResult<{books: unknown[]}>;
const dataAttributeName = 'graphql_data';

afterEach(() => {
Expand Down

0 comments on commit 19acc6e

Please sign in to comment.