136 questions
0 votes
0 answers
165 views
Unable to Connect Apollo GraphQL Sandbox to My Local Graphql Server
I'm running a GraphQL server using Rails with the graphql-ruby and graphiql-rails gems. I can access the GraphiQL interface successfully. I've set up a POST route at /graphql that maps to graphql#...
0 votes
2 answers
381 views
Ruby Graphql: Found two visible definitions for UpdateTransactionInput
I'm using the graphql gem and I'm having issue to create a mutation to update a recor. This is where the mutation type is first defined: module Types class MutationType < Types::BaseObject ...
0 votes
1 answer
64 views
How to set the complexity of __typename in graphql-ruby
In a Rails application using the graphql-ruby gem, how do I make it so that the __typename does not add up to the complexity of the query? By default, the complexity of all fields is 1, but I want to ...
3 votes
0 answers
229 views
Investigating the performance of a Ruby gem with Rust extension
Introduction After reading Ruby Outperforms C article I got curious how Rust would perform. So I started working on a Ruby gem with Rust extension that implements a GraphQL parser. For the parser ...
0 votes
1 answer
70 views
Rails GraphQL query on nested type
I have a rails app and I use gem GraphQL. The app contain this type in: app/graphql/types/category_type.rb module Types class CategoryType < Types::BaseObject field :id, ID, null: false ...
0 votes
1 answer
164 views
Ruby GraphQL returning union type from query
I want to make a query return a union type My union type: class LeadType < ::Types::BaseUnion description "Lead" possible_types WebsiteLeadType def self.resolve_type(object, ...
0 votes
1 answer
245 views
How to extend and override attributes from other class from same module?
While working with graphql in Rails, I am using this to define the arguments of a mutation/update that I want to perform on a Product record. So far, this is the file that I use to define the ...
0 votes
0 answers
208 views
Graphql-ruby Use types to format data outside of graphql
I was wondering, is there a way to apply the types declared in our Graphql API to format data the same way graphql does it with the return value if a query. There are other ways to do that, (like ...
0 votes
1 answer
172 views
After upgrading Rails from 6.1.7 to 7.0.4 - @vue/apollo-composable useQuery doesn't do request
I'm in the process of upgrading my app which uses the following stack: gems: rails 6.1.7 graphql 2.0.19 npms: @apollo/client 3.7.10 @vue/apollo-composable ^4.0.0-beta.4 vue ^3.2.47 This works fine. ...
0 votes
1 answer
206 views
How can a many-to-many join table's attributes be exposed in a GraphQL-Ruby edge?
I'm in the process of building a GraphQL API in a Rails 7 application, using the graphql-ruby gem. In the app, users can create lists of catalogue items, and their lists can be manually ordered. So ...
0 votes
3 answers
812 views
Coercion error when passing Boolean argument in graphql-ruby mutation query
I have a simple graphql-ruby mutation: class Mutations::User::Destroy < Mutations::BaseMutation argument :confirm, GraphQL::Types::Boolean, required: true payload_type GraphQL::Types::Boolean ...
0 votes
1 answer
408 views
Query string argument should be a String -Rails Action Cable & graphql through apollo
I am using rails 6.1 graphql gem with Apollo to execute a subscription. It works for normal queries and mutations but rails complains about subscriptions. In my frontend: const cable = ActionCable....
0 votes
1 answer
765 views
What is the proper way to use Graphql JSON Scalar in Rails?
I have a type that looks like this: module Types class LeadType < Types::BaseObject graphql_name 'Lead' description 'A lead data query selection' field :first_name, String, null: true ...
2 votes
1 answer
1k views
Using a List in a GraphQL Union type (in Ruby)
The GraphQL Ruby documentation shows how to define a union type: class Types::CommentSubject < Types::BaseUnion description "Objects which may be commented on" possible_types Types::...
3 votes
1 answer
374 views
How do I raise two errors with graphql-ruby?
I'm using the graphql-ruby gem and I have a mutation that updates a record. This is all working, but now I want to include the phony_rails gem to validate phone number. The problem As a dev with more ...