Instrumentation
To instrument your GraphQL app using AppSignal, load the AppSignal middleware in your schema.- Reference: GraphQL AppSignal docs.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
# TODO: Change the schema class to your schema class
class MySchema < GraphQL::Schema
trace_with(GraphQL::Tracing::AppsignalTrace)
end
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
Was this page helpful?