# How to get values/requests from graphql ?

**URL:** <https://community.dynatrace.com/t/how-to-get-values-requests-from-graphql/36726>\
**Category:** Open Q&A\
**Tags:** technologies, dynatrace-managed, request-attributes\
**Created:** [September 30, 2022, 9:59am UTC](https://community.dynatrace.com/t/how-to-get-values-requests-from-graphql/36726 "2022-09-30T09:59:23Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zimmer](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/zimmer/32/39228_2.png) [@Zimmer](https://community.dynatrace.com/u/Zimmer)\
**Post date:** [September 30, 2022, 9:59am UTC](https://community.dynatrace.com/t/how-to-get-values-requests-from-graphql/36726/1 "2022-09-30T09:59:23Z")

</div>

Hello,&nbsp;  
&nbsp;I have an issue with I can’t get requests which are toward to graphql. It simply shows only [https://example.com/graphql](https://example.com/graphql)&nbsp; &nbsp;and when you click on the link you can find the request inside like [https://example.com/graphql/18293/product](https://example.com/graphql)

How to clean up the rule in a way to show all requests instead of only graphql?

Thanks.

---

<div class="post-metadata">

**Author:** ![gilgi](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/gilgi/32/11747_2.png) [@gilgi](https://community.dynatrace.com/u/gilgi)\
**Post date:** [October 1, 2022, 6:04am UTC](https://community.dynatrace.com/t/how-to-get-values-requests-from-graphql/36726/2 "2022-10-01T06:04:47Z")

</div>

Hi [@Zimmer](https://community.dynatrace.com/user/53077)&nbsp;,

I know your pain.. can you tell which technologies and libraries we use. We have a customer running graphql in java and using the expediagroup library.

We’ve managed to find a method that returns the operation name of the query.

It was on the&nbsp;com.expediagroup.graphql.client.types.GraphQLClientRequest class and the method was getOperationName.

Ince we’ve had it we changed thebrequest names based on the values.

Hope this helps.

---

<div class="post-metadata">

**Author:** ![Zimmer](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/zimmer/32/39228_2.png) [@Zimmer](https://community.dynatrace.com/u/Zimmer)\
**Post date:** [October 3, 2022, 5:46pm UTC](https://community.dynatrace.com/t/how-to-get-values-requests-from-graphql/36726/3 "2022-10-03T17:46:35Z")

</div>

We’re using&nbsp;[ASP.NET](http://ASP.NET) Core 😞 still no luck with the solution.. sigh.

---

<div class="post-metadata">

**Author:** ![rameshwiz07](https://avatars.discourse-cdn.com/v4/letter/r/258eb7/32.png) [@rameshwiz07](https://community.dynatrace.com/u/rameshwiz07)\
**Post date:** [October 4, 2022, 12:04pm UTC](https://community.dynatrace.com/t/how-to-get-values-requests-from-graphql/36726/4 "2022-10-04T12:04:49Z")

</div>

Hi&nbsp;[@gilgi](https://community.dynatrace.com/user/12008)

we are using kickstart GraphQL for our springboot api ([GitHub - graphql-java-kickstart/graphql-spring-boot: GraphQL and GraphiQL Spring Framework Boot Starters - ■■■■■■ from oembedler/graphql-spring-boot due to inactivity. · GitHub](https://github.com/graphql-java-kickstart/graphql-spring-boot)) .

Is there any way we can get the operation names (query and mutation names ) ?

Thanks

---

<div class="post-metadata">

**Author:** ![Zimmer](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/zimmer/32/39228_2.png) [@Zimmer](https://community.dynatrace.com/u/Zimmer)\
**Post date:** [October 5, 2022, 7:42am UTC](https://community.dynatrace.com/t/how-to-get-values-requests-from-graphql/36726/5 "2022-10-05T07:42:01Z")

</div>

If you will find the solution, please share it with the community also.&nbsp;  
Thanks 🙂

---

<div class="post-metadata">

**Author:** ![gilgi](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/gilgi/32/11747_2.png) [@gilgi](https://community.dynatrace.com/u/gilgi)\
**Post date:** [October 11, 2022, 12:35pm UTC](https://community.dynatrace.com/t/how-to-get-values-requests-from-graphql/36726/6 "2022-10-11T12:35:18Z")

</div>

It seems like if you look at&nbsp;[https://github.com/graphql-java-kickstart/graphql-spring-boot/blob/master/graphql-kickstart-spring-webflux/src/main/java/graphql/kickstart/spring/webflux/GraphQLController.java,](https://github.com/graphql-java-kickstart/graphql-spring-boot/blob/master/graphql-kickstart-spring-webflux/src/main/java/graphql/kickstart/spring/webflux/GraphQLController.java)&nbsp;you’ll see that you can actuallyu create a request attribute on&nbsp;graphql.kickstart.spring.webflux.GraphQLController.executeRequest and capture the first two parameters. The first one is the query and the second one is the operation name.

once you do that you can also rename your requests based on either values.

On another note, We found out that at least in the expedia version, the network protocol used in the http commands was gql. Once replaced by http or https (as this is an open source packaged), Dynatrace supported this out of the box.

One last thing: in the link you’ve sent I’ve seen that it is using Apolo Server. I’ve seen posts that describe OpenTelemtry support for Apolo Server. This could alos be a viable solution as the OneAgent automatically can collect OpenTelemtry data.

Hope I’ve managed to help.

---

<div class="post-metadata">

**Author:** ![Zimmer](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/zimmer/32/39228_2.png) [@Zimmer](https://community.dynatrace.com/u/Zimmer)\
**Post date:** [October 11, 2022, 12:46pm UTC](https://community.dynatrace.com/t/how-to-get-values-requests-from-graphql/36726/7 "2022-10-11T12:46:28Z")

</div>

Hi [@gilgi](https://community.dynatrace.com/user/12008)&nbsp; could you please correct the GitHub link it goes to a 404 page not found. there is, comma at the end of the link  
Thanks

---

<div class="post-metadata">

**Author:** ![MaciejNeumann](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@MaciejNeumann](https://community.dynatrace.com/u/MaciejNeumann)\
**Post date:** [October 11, 2022, 12:51pm UTC](https://community.dynatrace.com/t/how-to-get-values-requests-from-graphql/36726/8 "2022-10-11T12:51:47Z")

</div>

Hi&nbsp;[@Zimmer](https://community.dynatrace.com/user/53077),

I’ve edited the link, it should work now&nbsp;:slightly\_smiling\_face:

---

<div class="post-metadata">

**Author:** ![gilgi](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/gilgi/32/11747_2.png) [@gilgi](https://community.dynatrace.com/u/gilgi)\
**Post date:** [October 11, 2022, 12:52pm UTC](https://community.dynatrace.com/t/how-to-get-values-requests-from-graphql/36726/9 "2022-10-11T12:52:48Z")

</div>

[@Zimmer](https://community.dynatrace.com/user/53077)&nbsp;it works for me. The link is&nbsp;[graphql-spring-boot/graphql-kickstart-spring-webflux/src/main/java/graphql/kickstart/spring/webflux/GraphQLController.java at master · graphql-java-kickstart/graphql-spring-boot · GitHub](https://github.com/graphql-java-kickstart/graphql-spring-boot/blob/master/graphql-kickstart-spring-webflux/src/main/java/graphql/kickstart/spring/webflux/GraphQLController.java)

---

<div class="post-metadata">

**Author:** ![Zimmer](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/zimmer/32/39228_2.png) [@Zimmer](https://community.dynatrace.com/u/Zimmer)\
**Post date:** [October 11, 2022, 1:16pm UTC](https://community.dynatrace.com/t/how-to-get-values-requests-from-graphql/36726/10 "2022-10-11T13:16:31Z")

</div>

I still don’t understand how to get values from the payload in the header there is only&nbsp;[https://example.com:8443/graphql](https://example.com:8443/graphql)&nbsp;request but in the payload, there is information that I want to catch with dynatrace like this :

```markup
{"variables":{"from":"CAD","to":"USD"},"query":"query ($from: String, $to: String) {\n currencyRates(from: $from, to: $to) {\n currency\n buyRate\n currencyId\n nBGRate\n sellRate\n}\n}\n"}

```

Still, no luck, can’t get it from the backend (.NET) or from the frontend which is based on Angular 9.

---

<div class="post-metadata">

**Author:** ![gilgi](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/gilgi/32/11747_2.png) [@gilgi](https://community.dynatrace.com/u/gilgi)\
**Post date:** [October 11, 2022, 1:30pm UTC](https://community.dynatrace.com/t/how-to-get-values-requests-from-graphql/36726/11 "2022-10-11T13:30:47Z")

</div>

[@Zimmer](https://community.dynatrace.com/user/53077)&nbsp;as you cannot parse the payload itself, you must get the values from the server side. Whice graphql library are you using?

---

<div class="post-metadata">

**Author:** ![Zimmer](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/zimmer/32/39228_2.png) [@Zimmer](https://community.dynatrace.com/u/Zimmer)\
**Post date:** [October 17, 2022, 1:33pm UTC](https://community.dynatrace.com/t/how-to-get-values-requests-from-graphql/36726/12 "2022-10-17T13:33:16Z")

</div>

We are using&nbsp;.NET library GraphQL v 4.2.0&nbsp; have you had any experience with that? I appreciate your support.

---

<div class="post-metadata">

**Author:** ![gilgi](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/gilgi/32/11747_2.png) [@gilgi](https://community.dynatrace.com/u/gilgi)\
**Post date:** [October 18, 2022, 5:11am UTC](https://community.dynatrace.com/t/how-to-get-values-requests-from-graphql/36726/13 "2022-10-18T05:11:12Z")

</div>

Looking at the source code in [Git](https://github.com/graphql-dotnet/graphql-dotnet/blob/master/src/GraphQL/Execution/IExecutionContext.cs) (hopefully this is the right one), I would try to create 2 request attributes:

1. On&nbsp;GraphQL.Execution.IExecutionContext.Operation (which is the operation Name)

2. On&nbsp;GraphQL.Execution.IExecutionContext.Document (Which is the request itself)

Hope this helps.

---

<div class="post-metadata">

**Author:** ![Zimmer](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/zimmer/32/39228_2.png) [@Zimmer](https://community.dynatrace.com/u/Zimmer)\
**Post date:** [November 14, 2022, 7:53pm UTC](https://community.dynatrace.com/t/how-to-get-values-requests-from-graphql/36726/14 "2022-11-14T19:53:45Z")

</div>

Could you guide me or share your experience regarding the Frontend side? How do I catch the values which are in payload for further manipulation?&nbsp;  
Frontend application is written on AngularJS

thanks

---

<div class="post-metadata">

**Author:** ![gilgi](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/gilgi/32/11747_2.png) [@gilgi](https://community.dynatrace.com/u/gilgi)\
**Post date:** [November 27, 2022, 12:52pm UTC](https://community.dynatrace.com/t/how-to-get-values-requests-from-graphql/36726/15 "2022-11-27T12:52:37Z")

</div>

Hi,

There is no way to capture the payload from the client side without writing your own js code to capture the interesting data and then utilize the Dynatrace JS sdk to send it back. What I would try to look for is to find out where the paylaod is being constructed on the server side and then define a request attribute. On the application definition pages you could then create user action property to gather value from this request attribute.

---

<div class="post-metadata">

**Author:** ![Zimmer](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/zimmer/32/39228_2.png) [@Zimmer](https://community.dynatrace.com/u/Zimmer)\
**Post date:** [November 28, 2022, 5:24am UTC](https://community.dynatrace.com/t/how-to-get-values-requests-from-graphql/36726/16 "2022-11-28T05:24:11Z")

</div>

Hi gilgi,  
Yeah, that’s exactly what we did and it worked fine. We’re continuing testing let’s see what we can get more from it.

Thank you for your suggestions and help​🤙
