GraphQL::Pro::StableRelationConnection does not quote table and column names
Describe the bug
When adding columns to the SELECT and ORDER BY clauses of the underlying ActiveRecord::Relation, GraphQL::Pro::StableRelationConnection does not quote the table and column names as ActiveRecord normally does. If you have table and column names that are also SQL keywords, invalid SQL will be generated.
In my case, the application uses singular table names and has a table named order. For an Order ConnectionType, StableRelationConnection generates SQL like:
SELECT order.*, order.id AS cursor_0 FROM "order" ORDER BY order.id asc
Whereas ActiveRecord would normally generate:
SELECT "order".* FROM "order" ORDER BY "order"."id" ASC
(I know having such table and column names is asking for trouble. The names were not my choice. 😒)
Versions
graphql version: 2.0.22
graphql-pro version: 1.24.4
rails version: 7.0.4.3
Steps to reproduce
class CreateReproTables < ActiveRecord::Migration[7.0]
def change
create_table :order do |t|
t.integer :amount_cents, null: false
end
end
end
CreateReproTables.migrate(:up)
class Order < ActiveRecord::Base
self.table_name = 'order'
end
3.times { Order.create!(amount_cents: rand(1_000..99_999)) }
module Types; end
class Types::Order < GraphQL::Schema::Object
field :amount_cents, Int, null: false
end
class Types::QueryType < GraphQL::Schema::Object
field :orders, Types::Order.connection_type, null: false
def orders
Order.all
end
end
class ReproSchema < GraphQL::Schema
query Types::QueryType
connections.add(
ActiveRecord::Relation, GraphQL::Pro::PostgresStableRelationConnection
)
end
result = ReproSchema.execute(<<-GRAPHQL)
query { orders { nodes { amountCents } } }
GRAPHQL
puts result.dig('data', 'orders', 'nodes').length
Expected behavior
Outputs:
3
Actual behavior
Outputs:
/home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.4.3/lib/active_record/connection_adapters/postgresql_adapter.rb:768:in `exec_params': PG::SyntaxError: ERROR: syntax error at or near "." (ActiveRecord::StatementInvalid)
LINE 1: SELECT order.*, order.id AS cursor_0 FROM "order" ORDER BY o...
^
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.4.3/lib/active_record/connection_adapters/postgresql_adapter.rb:768:in `block (2 levels) in exec_no_cache'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.4.3/lib/active_support/concurrency/share_lock.rb:187:in `yield_shares'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.4.3/lib/active_support/dependencies/interlock.rb:41:in `permit_concurrent_loads'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.4.3/lib/active_record/connection_adapters/postgresql_adapter.rb:767:in `block in exec_no_cache'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.4.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.4.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.4.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.4.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.4.3/lib/active_record/connection_adapters/abstract_adapter.rb:765:in `block in log'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.4.3/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.4.3/lib/active_record/connection_adapters/abstract_adapter.rb:756:in `log'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.4.3/lib/active_record/connection_adapters/postgresql_adapter.rb:766:in `exec_no_cache'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.4.3/lib/active_record/connection_adapters/postgresql_adapter.rb:745:in `execute_and_clear'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.4.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:54:in `exec_query'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.4.3/lib/active_record/connection_adapters/abstract/database_statements.rb:560:in `select'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.4.3/lib/active_record/connection_adapters/abstract/database_statements.rb:66:in `select_all'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.4.3/lib/active_record/connection_adapters/abstract/query_cache.rb:110:in `select_all'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.4.3/lib/active_record/querying.rb:54:in `_query_by_sql'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.4.3/lib/active_record/relation.rb:942:in `block in exec_main_query'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.4.3/lib/active_record/relation.rb:962:in `skip_query_cache_if_necessary'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.4.3/lib/active_record/relation.rb:928:in `exec_main_query'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.4.3/lib/active_record/relation.rb:914:in `block in exec_queries'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.4.3/lib/active_record/relation.rb:962:in `skip_query_cache_if_necessary'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.4.3/lib/active_record/relation.rb:908:in `exec_queries'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.4.3/lib/active_record/relation.rb:695:in `load'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.4.3/lib/active_record/relation.rb:250:in `records'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.4.3/lib/active_record/relation/delegation.rb:88:in `each'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/execution/interpreter/runtime.rb:846:in `continue_field'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/execution/interpreter/runtime.rb:566:in `block (2 levels) in evaluate_selection_with_resolved_keyword_args'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/execution/interpreter/runtime.rb:1018:in `after_lazy'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/execution/interpreter/runtime.rb:563:in `block in evaluate_selection_with_resolved_keyword_args'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/execution/interpreter/runtime.rb:902:in `call_method_on_directives'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/execution/interpreter/runtime.rb:548:in `evaluate_selection_with_resolved_keyword_args'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/execution/interpreter/runtime.rb:459:in `evaluate_selection'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/execution/interpreter/runtime.rb:388:in `block (2 levels) in evaluate_selections'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/dataloader/null_dataloader.rb:19:in `append_job'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/execution/interpreter/runtime.rb:387:in `block in evaluate_selections'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/execution/interpreter/runtime.rb:386:in `each'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/execution/interpreter/runtime.rb:386:in `evaluate_selections'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/execution/interpreter/runtime.rb:823:in `block (3 levels) in continue_field'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/execution/interpreter/runtime.rb:902:in `call_method_on_directives'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/execution/interpreter/runtime.rb:822:in `block (2 levels) in continue_field'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/execution/interpreter/runtime.rb:236:in `tap_or_each'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/execution/interpreter/runtime.rb:803:in `block in continue_field'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/execution/interpreter/runtime.rb:1018:in `after_lazy'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/execution/interpreter/runtime.rb:789:in `continue_field'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/execution/interpreter/runtime.rb:566:in `block (2 levels) in evaluate_selection_with_resolved_keyword_args'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/execution/interpreter/runtime.rb:1018:in `after_lazy'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/execution/interpreter/runtime.rb:563:in `block in evaluate_selection_with_resolved_keyword_args'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/execution/interpreter/runtime.rb:902:in `call_method_on_directives'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/execution/interpreter/runtime.rb:548:in `evaluate_selection_with_resolved_keyword_args'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/execution/interpreter/runtime.rb:524:in `block in evaluate_selection_with_args'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/execution/interpreter/runtime.rb:1018:in `after_lazy'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/execution/interpreter/runtime.rb:473:in `evaluate_selection_with_args'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/execution/interpreter/runtime.rb:467:in `block in evaluate_selection'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/execution/interpreter/arguments_cache.rb:51:in `block in dataload_for'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/schema/member/has_arguments.rb:288:in `block (3 levels) in coerce_arguments'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/dataloader/null_dataloader.rb:19:in `append_job'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/schema/member/has_arguments.rb:269:in `block (2 levels) in coerce_arguments'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/schema/member/has_arguments.rb:268:in `each'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/schema/member/has_arguments.rb:268:in `block in coerce_arguments'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/schema/member/has_arguments.rb:297:in `coerce_arguments'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/execution/interpreter/arguments_cache.rb:49:in `dataload_for'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/execution/interpreter/runtime.rb:466:in `evaluate_selection'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/execution/interpreter/runtime.rb:388:in `block (2 levels) in evaluate_selections'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/dataloader/null_dataloader.rb:19:in `append_job'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/execution/interpreter/runtime.rb:387:in `block in evaluate_selections'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/execution/interpreter/runtime.rb:386:in `each'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/execution/interpreter/runtime.rb:386:in `evaluate_selections'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/execution/interpreter/runtime.rb:284:in `block (4 levels) in run_eager'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/execution/interpreter/runtime.rb:902:in `call_method_on_directives'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/execution/interpreter/runtime.rb:283:in `block (3 levels) in run_eager'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/dataloader/null_dataloader.rb:19:in `append_job'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/execution/interpreter/runtime.rb:275:in `block (2 levels) in run_eager'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/execution/interpreter/runtime.rb:236:in `tap_or_each'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/execution/interpreter/runtime.rb:266:in `block in run_eager'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/execution/interpreter/runtime.rb:902:in `call_method_on_directives'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/execution/interpreter/runtime.rb:257:in `run_eager'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/execution/interpreter.rb:75:in `block (6 levels) in run_all'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/tracing/trace.rb:43:in `execute_query'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/execution/interpreter.rb:74:in `block (5 levels) in run_all'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/dataloader/null_dataloader.rb:19:in `append_job'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/execution/interpreter.rb:62:in `block (4 levels) in run_all'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/execution/interpreter.rb:61:in `each'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/execution/interpreter.rb:61:in `each_with_index'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/execution/interpreter.rb:61:in `block (3 levels) in run_all'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/execution/interpreter.rb:171:in `block (2 levels) in each_query_call_hooks'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/execution/interpreter.rb:166:in `each_query_call_hooks'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/execution/interpreter.rb:170:in `block in each_query_call_hooks'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/execution/interpreter.rb:197:in `call_hooks'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/execution/interpreter.rb:169:in `each_query_call_hooks'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/execution/interpreter.rb:46:in `block (2 levels) in run_all'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/execution/interpreter.rb:197:in `call_hooks'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/execution/interpreter.rb:45:in `block in run_all'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/tracing/trace.rb:39:in `execute_multiplex'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/execution/interpreter.rb:37:in `run_all'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/schema.rb:1069:in `multiplex'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/graphql-2.0.22/lib/graphql/schema.rb:1045:in `execute'
from /home/jtrull/Spikes/graphql-repro/lib/repro.rb:40:in `<top (required)>'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/railties-7.0.4.3/lib/rails/commands/runner/runner_command.rb:43:in `load'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/railties-7.0.4.3/lib/rails/commands/runner/runner_command.rb:43:in `perform'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/thor-1.2.2/lib/thor/command.rb:27:in `run'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/thor-1.2.2/lib/thor/invocation.rb:127:in `invoke_command'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/thor-1.2.2/lib/thor.rb:392:in `dispatch'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/railties-7.0.4.3/lib/rails/command/base.rb:87:in `perform'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/railties-7.0.4.3/lib/rails/command.rb:48:in `invoke'
from /home/jtrull/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/railties-7.0.4.3/lib/rails/commands.rb:18:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
Hi! Thanks for the detailed report and sorry for the trouble. It looks like I need to update it to use quote_... methods from ActiveRecord. I'll take a look and follow up here soon!
I just released graphql-pro 1.24.5 with better quoting in SELECT and ORDER -- please give that version a try and let me know if you have any more trouble with it!