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

graphql instrumentation: support v16 #885

Closed
blumamir opened this issue Feb 11, 2022 · 1 comment
Closed

graphql instrumentation: support v16 #885

blumamir opened this issue Feb 11, 2022 · 1 comment

Comments

@blumamir
Copy link
Member

following #883 renovate's tried to update the dependency of graphql from v15 to v16 and there are errors durig compile phase. This issue is about fixing these errors so instrumentation supports v16 of graphql, and adding the new major to test-all-versions

src/instrumentation.ts:154:47 - error TS2345: Argument of type '(original: validateType) => validateType' is not assignable to parameter of type '(original: (schema: GraphQLSchema, documentAST: DocumentNode, rules?: readonly ValidationRule[] | undefined, options?: { maxErrors?: number | undefined; } | undefined, typeInfo?: TypeInfo | undefined) => readonly GraphQLError[]) => (schema: GraphQLSchema, documentAST: DocumentNode, rules?: readonly ValidationRule[] ...'.
  Types of parameters 'original' and 'original' are incompatible.
    Types of parameters 'options' and 'typeInfo' are incompatible.
      Type 'TypeInfo | undefined' is not assignable to type '{ maxErrors?: number | undefined; } | undefined'.
        Type 'TypeInfo' has no properties in common with type '{ maxErrors?: number | undefined; }'.

154         this._wrap(moduleExports, 'validate', this._patchValidate());
                                                  ~~~~~~~~~~~~~~~~~~~~~

src/utils.ts:[389](https://github.com/open-telemetry/opentelemetry-js-contrib/runs/5150816703?check_suite_focus=true#step:8:389):11 - error TS2345: Argument of type '() => unknown' is not assignable to parameter of type '() => Maybe<GraphQLFieldResolver<TSource, TContext, TArgs, unknown>> | Promise<Maybe<GraphQLFieldResolver<TSource, TContext, TArgs, unknown>>>'.
  Type 'unknown' is not assignable to type 'Maybe<GraphQLFieldResolver<TSource, TContext, TArgs, unknown>> | Promise<Maybe<GraphQLFieldResolver<TSource, TContext, TArgs, unknown>>>'.
    Type 'unknown' is not assignable to type 'Promise<Maybe<GraphQLFieldResolver<TSource, TContext, TArgs, unknown>>>'.

389           () => {
              ~~~~~~~

test/graphql.test.ts:110:31 - error TS2554: Expected 1 arguments, but got 2.

110         await graphql(schema, sourceList1);
                                  ~~~~~~~~~~~

test/graphql.test.ts:233:31 - error TS2554: Expected 1 arguments, but got 2.

233         await graphql(schema, sourceBookById);
                                  ~~~~~~~~~~~~~~

test/graphql.test.ts:317:31 - error TS2554: Expected 1 arguments, but got 5.

317         await graphql(schema, sourceFindUsingVariable, null, null, {
                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
318           id: 2,
    ~~~~~~~~~~~~~~~~
319         });
    ~~~~~~~~~

test/graphql.test.ts:[411](https://github.com/open-telemetry/opentelemetry-js-contrib/runs/5150816703?check_suite_focus=true#step:8:411):31 - error TS2554: Expected 1 arguments, but got 2.

411         await graphql(schema, sourceList1);
                                  ~~~~~~~~~~~

test/graphql.test.ts:[475](https://github.com/open-telemetry/opentelemetry-js-contrib/runs/5150816703?check_suite_focus=true#step:8:475):31 - error TS2554: Expected 1 arguments, but got 2.

475         await graphql(schema, sourceList1);
                                  ~~~~~~~~~~~

test/graphql.test.ts:538:31 - error TS2554: Expected 1 arguments, but got 2.

538         await graphql(schema, sourceList1);
                                  ~~~~~~~~~~~

test/graphql.test.ts:562:31 - error TS2554: Expected 1 arguments, but got 2.

562         await graphql(schema, sourceBookById);
                                  ~~~~~~~~~~~~~~

test/graphql.test.ts:648:31 - error TS2554: Expected 1 arguments, but got 2.

648         await graphql(schema, sourceAddBook);
                                  ~~~~~~~~~~~~~

test/graphql.test.ts:738:31 - error TS2554: Expected 1 arguments, but got 5.

738         await graphql(schema, sourceFindUsingVariable, null, null, {
                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
739           id: 2,
    ~~~~~~~~~~~~~~~~
740         });
    ~~~~~~~~~

test/graphql.test.ts:832:29 - error TS2554: Expected 1 arguments, but got 2.

832       await graphql(schema, sourceAddBook);
                                ~~~~~~~~~~~~~

test/graphql.test.ts:921:29 - error TS2554: Expected 1 arguments, but got 2.

921       await graphql(schema, badQuery);
                                ~~~~~~~~

test/graphql.test.ts:956:29 - error TS2554: Expected 1 arguments, but got 2.

956       await graphql(schema, queryInvalid);
                                ~~~~~~~~~~~~

test/graphql.test.ts:1018:47 - error TS2554: Expected 1 arguments, but got 2.

1018         graphqlResult = await graphql(schema, sourceList1);
                                                   ~~~~~~~~~~~

test/graphql.test.ts:1041:47 - error TS2554: Expected 1 arguments, but got 2.

1041         graphqlResult = await graphql(schema, sourceList1);
                                                   ~~~~~~~~~~~

test/graphql.test.ts:1046:32 - error TS2571: Object is of type 'unknown'.

1046         assert.deepStrictEqual(graphqlResult.data?.books?.length, 13);
                                    ~~~~~~~~~~~~~~~~~~~~~~~~~

test/graphql.test.ts:1058:47 - error TS2554: Expected 1 arguments, but got 2.

1058         graphqlResult = await graphql(schema, sourceList1);
                                                   ~~~~~~~~~~~

test/graphql.test.ts:1063:32 - error TS2571: Object is of type 'unknown'.

1063         assert.deepStrictEqual(graphqlResult.data?.books?.length, 13);
                                    ~~~~~~~~~~~~~~~~~~~~~~~~~


Found 19 errors.
@vmarchaud
Copy link
Member

This was already tracked in #784

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants