Skip to content

Commit

Permalink
remove graphql/types dependency (#754)
Browse files Browse the repository at this point in the history
  • Loading branch information
nata7che authored Dec 14, 2021
1 parent 6766471 commit e3ce102
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
"typescript": "4.3.5"
},
"dependencies": {
"@opentelemetry/instrumentation": "^0.27.0",
"@types/graphql": "14.5.0"
"@opentelemetry/instrumentation": "^0.27.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import {
safeExecuteInTheMiddle,
} from '@opentelemetry/instrumentation';
import type * as graphqlTypes from 'graphql';
import { GraphQLFieldResolver } from 'graphql/type/definition';
import { SpanNames } from './enum';
import { AttributeNames } from './enums/AttributeNames';
import { OTEL_GRAPHQL_DATA_SYMBOL } from './symbols';
Expand Down Expand Up @@ -164,7 +163,7 @@ export class GraphQLInstrumentation extends InstrumentationBase {
}

private _patchExecute(
defaultFieldResolved: GraphQLFieldResolver<any, any>
defaultFieldResolved: graphqlTypes.GraphQLFieldResolver<any, any>
): (original: executeType) => executeType {
const instrumentation = this;
return function execute(original) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import {
GraphQLFieldResolver,
GraphQLTypeResolver,
} from 'graphql/type/definition';
import { GraphQLSchema } from 'graphql/type/schema';
import { OTEL_GRAPHQL_DATA_SYMBOL, OTEL_PATCHED_SYMBOL } from './symbols';

export const OPERATION_NOT_SUPPORTED =
Expand Down Expand Up @@ -100,7 +99,7 @@ export type executeFunctionWithArgs = (
) => PromiseOrValue<graphqlTypes.ExecutionResult>;

export interface OtelExecutionArgs {
schema: GraphQLSchema;
schema: graphqlTypes.GraphQLSchema;
document: DocumentNode & ObjectWithGraphQLData;
rootValue?: any;
contextValue?: any & ObjectWithGraphQLData;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

import type * as graphqlTypes from 'graphql';
import * as api from '@opentelemetry/api';
import { GraphQLObjectType } from 'graphql/type/definition';
import { AllowedOperationTypes, SpanNames, TokenKind } from './enum';
import { AttributeNames } from './enums/AttributeNames';
import { OTEL_GRAPHQL_DATA_SYMBOL, OTEL_PATCHED_SYMBOL } from './symbols';
Expand Down Expand Up @@ -293,7 +292,7 @@ export function getSourceFromLocation(
}

export function wrapFields(
type: Maybe<GraphQLObjectType & OtelPatched>,
type: Maybe<graphqlTypes.GraphQLObjectType & OtelPatched>,
tracer: api.Tracer,
getConfig: () => GraphQLInstrumentationParsedConfig
): void {
Expand Down

0 comments on commit e3ce102

Please sign in to comment.