Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(instrumentation-graphql): remove graphql/types dependency #754

Merged
merged 12 commits into from
Dec 14, 2021
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