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 plugin - temporary here for reviews - will be moved to contrib repo later #1573

Closed
wants to merge 4 commits into from

Conversation

obecny
Copy link
Member

@obecny obecny commented Oct 6, 2020

I'm pushing this here as instrumentation has not been published yet, once it is done I'm happy to move it to contrib, but for easier review this can be reviewed here too.

@codecov
Copy link

codecov bot commented Oct 6, 2020

Codecov Report

Merging #1573 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #1573   +/-   ##
=======================================
  Coverage   92.93%   92.93%           
=======================================
  Files         156      156           
  Lines        4871     4871           
  Branches      988      988           
=======================================
  Hits         4527     4527           
  Misses        344      344           

@obecny obecny changed the title Graphql plugin - temporary here - will be moved to contrib repo later Graphql plugin - temporary here foor reviews - will be moved to contrib repo later Oct 9, 2020
@obecny obecny changed the title Graphql plugin - temporary here foor reviews - will be moved to contrib repo later Graphql plugin - temporary here for reviews - will be moved to contrib repo later Oct 9, 2020
@obecny
Copy link
Member Author

obecny commented Oct 14, 2020

@open-telemetry/javascript-approvers ^^

* See the License for the specific language governing permissions and
* limitations under the License.
*/
// is moving to instrumentation
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#1572 has been merged so this need to be updated

private _addPatchingExecute(): InstrumentationNodeModuleFile<
typeof graphqlTypes
> {
const file = new InstrumentationNodeModuleFile<typeof graphqlTypes>(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we just return the newly created class instead of assigning it ?

'graphql/execution/execute.js',
// cannot make it work with appropriate type as execute function has 2
//types and/cannot import function but only types
(moduleExports: any) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use unknown here and check manuallly that the wrapped functions exist ?

document: graphqlTypes.DocumentNode,
rootValue: any,
contextValue: any,
variableValues: Maybe<{ [key: string]: any }>,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be Maybe<Record<string, any>>

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it needs to be the same as in graphql

*/

export * from './graphql';
export * from './symbols';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why should we export the symbols ? If thats just for the tests, could we just directly import them ?

* The maximum depth of fields/resolvers to instrument.
* When set to 0 it will not instrument fields and resolvers
*
* @default undefined
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't the default -1 ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no it is fine

@obecny
Copy link
Member Author

obecny commented Oct 20, 2020

closing in favour of open-telemetry/opentelemetry-js-contrib#226

@obecny obecny closed this Oct 20, 2020
@open-telemetry open-telemetry deleted a comment from vmarchaud Oct 20, 2020
@obecny
Copy link
Member Author

obecny commented Oct 20, 2020

@vmarchaud deleted my comment but it seems I have deleted yours accidently :/

@obecny obecny deleted the graphql branch February 2, 2021 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants