Skip to content

Conversation

@Tooyosi
Copy link
Collaborator

@Tooyosi Tooyosi commented Apr 13, 2025

Failure/Error:
  CaesarSchema = GraphQL::Schema.define do
    query(QueryRoot)
    mutation(MutationRoot)
  end

NoMethodError:
  undefined method `define' for GraphQL::Schema:Class
  Did you mean?  defined?
# ./app/graphql/caesar_schema.rb:1:in `<main>'
# ./spec/graphql/caesar_schema_spec.rb:3:in `<main>'

Error is caused due to changes from use of objects to classes from graphql 1.xx to 2.xx
See:
https://imaharu.github.io/graphql-ruby-doc-ja/schema/class_based_api.html
https://graphql-ruby.org/mutations/mutation_classes

@Tooyosi Tooyosi requested review from yuenmichelle1 and zwolf April 13, 2025 19:49
if next?
gem "rails", '~> 6.0'
else
gem 'rails', '~> 5.2'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bundler/DuplicatedGem: Gem rails requirements already given on line 15 of the Gemfile.

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.2'
if next?
gem "rails", '~> 6.0'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

@@ -1,3 +1,6 @@
def next?
File.basename(__FILE__) == "Gemfile.next"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

@@ -1,3 +1,6 @@
def next?
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/FrozenStringLiteralComment: Missing magic comment # frozen_string_literal: true.

class CaesarSchema < GraphQL::Schema
query(Types::QueryRoot)
mutation(Types::MutationRoot)
end
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Layout/TrailingBlankLines: Final newline missing.

@@ -0,0 +1,9 @@
# app/graphql/types/credential_type.rb
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/FrozenStringLiteralComment: Missing magic comment # frozen_string_literal: true.

field 'url', String, null: true
field 'status', Enums::DataRequestStatus, null: false
end
end
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Layout/EndAlignment: end at 12, 2 is not aligned with module at 2, 0.

@@ -0,0 +1,12 @@
# app/graphql/types/data_request.rb
module Types
class DataRequest < GraphQL::Schema::Object
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Layout/IndentationWidth: Use 2 (not 4) spaces for indentation.
Style/Documentation: Missing top-level class documentation comment.

@@ -0,0 +1,12 @@
# app/graphql/types/data_request.rb
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/FrozenStringLiteralComment: Missing magic comment # frozen_string_literal: true.

# app/graphql/types/enums/data_request_requested_data.rb
module Types
module Enums
class DataRequestRequestedData < GraphQL::Schema::Enum
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/Documentation: Missing top-level class documentation comment.

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