Sha256: c5cd55ccec55fee3d9c695df6cd1e13c04c8c09e6736e2966ff8b37214d46c81
Contents?: true
Size: 1.55 KB
Versions: 1
Compression:
Stored size: 1.55 KB
Contents
# frozen_string_literal: true require "spec_helper" describe GraphQL::Tracing::NewRelicTracing do module NewRelicTest class Query < GraphQL::Schema::Object field :int, Integer, null: false def int 1 end end class SchemaWithoutTransactionName < GraphQL::Schema query(Query) use(GraphQL::Tracing::NewRelicTracing) if TESTING_INTERPRETER use GraphQL::Execution::Interpreter end end class SchemaWithTransactionName < GraphQL::Schema query(Query) use(GraphQL::Tracing::NewRelicTracing, set_transaction_name: true) if TESTING_INTERPRETER use GraphQL::Execution::Interpreter end end end before do NewRelic.clear_all end it "can leave the transaction name in place" do NewRelicTest::SchemaWithoutTransactionName.execute "query X { int }" assert_equal [], NewRelic::TRANSACTION_NAMES end it "can override the transaction name" do NewRelicTest::SchemaWithTransactionName.execute "query X { int }" assert_equal ["GraphQL/query.X"], NewRelic::TRANSACTION_NAMES end it "can override the transaction name per query" do # Override with `false` NewRelicTest::SchemaWithTransactionName.execute "{ int }", context: { set_new_relic_transaction_name: false } assert_equal [], NewRelic::TRANSACTION_NAMES # Override with `true` NewRelicTest::SchemaWithoutTransactionName.execute "{ int }", context: { set_new_relic_transaction_name: true } assert_equal ["GraphQL/query.anonymous"], NewRelic::TRANSACTION_NAMES end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
graphql-1.9.0.pre1 | spec/graphql/tracing/new_relic_tracing_spec.rb |