EnjoyTech / apollo-studio-tracing-ruby

A Ruby implementation of Apollo Studio tracing
MIT License
6 stars 1 forks source link

"NoMethodError: undefined method `end_time=' for nil:NilClass" #34

Open letiesperon opened 1 year ago

letiesperon commented 1 year ago

I started getting the following error on one of my mutations when tracing is enabled:

Screenshot 2023-07-12 at 9 27 27 PM
:error => "NoMethodError: undefined method `end_time=' for nil:NilClass",
:backtrace => "/Users/letiesperon/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/apollo-studio-tracing-1.1.0/lib/apollo-studio-tracing/tracer.rb:228

I think it's related to the following nested input type:

module Types
  module Inputs
    class RegistrationAnswerInput < Types::BaseInputObject
      argument :question_id, ID,
               required: true,
               loads: Types::RegistrationQuestionType
      argument :options_ids, [ID],
               required: false,
               loads: Types::RegistrationQuestionOptionType
      argument :answer, String, required: false
    end
  end
end

Here are my mutation variables:

{
  "registrationAttributes": {
      "answers": [
        {
          "questionId": "RegistrationQuestion:WKpFyN",
          "answer":  "some free text answer"
        },
        {
          "questionId": "RegistrationQuestion:Wx8FlW",
          "optionsIds": [
            "RegistrationQuestionOption:5ZyFvm"
          ]
        },
        {
          "questionId": "RegistrationQuestion:DZyFeN",
          "answer": "free text answer"
        }, 
        // ... a couple more...
      ],
      "learnerId": "Learner:4zbuK6",
      "scheduleId": "Schedule:kx3f2e",
      "totalAmountToPayCents": 7200
  }
}

I'm saying that because I see the error right after the n+1 to load the questions is done.

Screenshot 2023-07-12 at 9 34 53 PM

Sorry I can't provide any more help or a PR to fix. I'm really just discovering we were even using the tracing feature and what it is