Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make executor_class optional in trace class #167

Closed
wants to merge 1 commit into from

Conversation

swalkinshaw
Copy link
Contributor

Otherwise Schema.new_trace will require executor_class as a keyword arg which is the wrong place to pass it in.

@rmosolgo should execute_multiplex check for the existence of executor_class or is this existing one enough?

unless executor
raise NoExecutorError, 'Cannot end a batch without an Executor.'
end

Otherwise `Schema.new_trace` will require `executor_class` as a keyword
arg which is the wrong place to pass it in.
@rmosolgo
Copy link
Contributor

I think this was in the right place. I ran into a bug here too, but I think it was a bug in GraphQL-Ruby (It was with backtrace: true), which I addressed in rmosolgo/graphql-ruby#4849

Did you encounter an error here too?

@swalkinshaw
Copy link
Contributor Author

swalkinshaw commented Feb 20, 2024

We actually aren't using the backtrace feature right now. I also patched our schema class with that fix and the exception still happens.

But you're right that this isn't the proper place to fix it. I think it's an issue with custom trace modes:

(ruby) Schema.trace_options_for(:default)
{:executor_class=>GraphQL::Batch::Executor, :schema_handle=>"admin"}
(ruby) Schema.trace_options_for(:metrics)
{:schema_handle=>"admin"}

In this case we're using Schema.new_trace(mode: :metrics).

@rmosolgo
Copy link
Contributor

Oh, OK -- different bug 😅 I think this will fix it: rmosolgo/graphql-ruby#4850

(It should just work -- the option given to the default mode should have been available to downstream, derived modes, too. The trace module was mixed in, but the options hash wasn't properly merged.)

@swalkinshaw
Copy link
Contributor Author

looks good, thank you 🎉

@swalkinshaw swalkinshaw deleted the trace-make-executor-class-optional branch February 20, 2024 21:24
@rmosolgo
Copy link
Contributor

Cool -- I just released in GraphQL-Ruby v.2.2.10! Let me know if you run into any more trouble with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants