> ## Documentation Index
> Fetch the complete documentation index at: https://docs.appsignal.com/llms.txt
> Use this file to discover all available pages before exploring further.

# GraphQL

[GraphQL](https://graphql-ruby.org/) is de Ruby-gem voor GraphQL-servers. AppSignal ondersteunt de GraphQL-gem via de ingebouwde instrumentatiemodule in de GraphQL-gem.

## Instrumentatie

Om uw GraphQL-app te instrumenteren met AppSignal, laadt u de AppSignal-middleware in uw schema.

<CodeGroup>
  ```ruby Ruby theme={null}
  # TODO: Change the schema class to your schema class
  class MySchema < GraphQL::Schema
    trace_with(GraphQL::Tracing::AppsignalTrace)
  end
  ```
</CodeGroup>

* Referentie: [GraphQL AppSignal-documentatie](https://graphql-ruby.org/queries/tracing.html#appsignal).

## Namespace en actie aanpassen

U kunt de instrumentatiehelpermethoden van AppSignal gebruiken om uw instrumentatie verder aan te passen. In het onderstaande voorbeeld groeperen we de requests op [namespace](/guides/namespaces) en actienaam:

<CodeGroup>
  ```ruby Ruby theme={null}
  class GraphqlController < ApplicationController
    def create
      result = MySchema.execute(params[:query], :variables => params[:variables], :context => {})
      render :json => result
    ensure
      # Customize the namespace
      Appsignal::Transaction.current.set_namespace("graphql")
      # Customize the action name based on the operationName, if any
      Appsignal::Transaction.current.set_action(params[:operationName] || "Unknown")
    end
  ```
</CodeGroup>
