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 request formatting #1022

Closed
goofiw opened this issue May 6, 2021 · 6 comments
Closed

graphql request formatting #1022

goofiw opened this issue May 6, 2021 · 6 comments

Comments

@goofiw
Copy link

goofiw commented May 6, 2021

Is anyone aware or a premade graphql request context parser?

It looks like I could write something and put it in customProps, however if there's something written out there, or a better way to plug in gql specific parsing, I'd love to hear it.

Specifically, I'm hoping to get:

  • query/mutation Name
  • resolvers called
  • argumants
@mcollina
Copy link
Member

mcollina commented May 6, 2021

What are you using on the graphql side? have you got an example?

I don't think it's possible to get the resolvers called.

@goofiw
Copy link
Author

goofiw commented May 12, 2021

I'm using apollo server.

It doesn't need to call any resolvers, just parse which resolvers the query is calling as well as the fields.

I did something basic by adding the request body to the res object, but some more informative (and queryable) parsing would be cool

@mcollina
Copy link
Member

I think you should develop a serializer that is apollo-specific (possibly in a different module).

@goofiw
Copy link
Author

goofiw commented May 12, 2021

Thanks @mcollina that's a potential outcome unless someone else seeing this knows of anything that's already been made.

@razor-x
Copy link

razor-x commented Aug 17, 2021

If this helps, I wrote one a while ago when I made a wrapper around apollo client. It worked very well for our team: https://github.com/meltwater/mlabs-graphql/blob/master/lib/client/logging.js

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants