The current consul GraphQL API has two problems. 1) It uses some unnecessary complicated magic to automatically create the GraphQL types and querys using an `api.yml` file. This approach is over-engineered, complex and has no benefits. It's just harder to understand the code for people which are not familiar with the project (like me, lol). 2) It uses a deprecated DSL [1] that is soon going to be removed from `graphql-ruby` completely. We are already seeing deprecation warning because of this (see References). There was one problem. I wanted to create the API so that it is fully backwards compatible with the old one, BUT the old one uses field names which are directly derived from the ruby code, which results in snake_case field names - not the GraphQL way. When I'm using the graphql-ruby Class-based syntax, it automatically creates the fields in camelCase, which breaks backwards-compatibility. So I've added deprecated snake_case field names to keep it backwards-compatible. [1] https://graphql-ruby.org/schema/class_based_api.html
6 lines
123 B
Ruby
6 lines
123 B
Ruby
module Mutations
|
|
class BaseMutation < GraphQL::Schema::RelayClassicMutation
|
|
object_class Types::BaseObject
|
|
end
|
|
end
|