rmosolgo / rmosolgo/graphql-ruby
GraphQL Changeset API to rename a type
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 5.4k
- Forks
- 1.4k
- Avg merge
- 23h 19m
- Merged PRs (30d)
- 28
Description
Is your feature request related to a problem? Please describe.
I am trying to change the graphql_name of a type using a Changeset, but the syntax is not valid
undefined method `graphql_name' for #<GraphQL::Enterprise::Changeset::Modification:0x0000ffff76e84fb0 @schema_member=Voyager::Types::Enums::AttemptServiceName, @changeset=Changesets::VoyagerAttemptServiceRename>
Describe the solution you'd like
class Changesets::ServiceNameRename < GraphQL::Enterprise::Changeset
release "2022-09-28"
modifies Types::Enums::ServiceName do
graphql_name "BetterName"
end
end
Describe alternatives you've considered
I guess this can also be achieved by creating a new type constant which extends the original, but call graphql_name to rename the new constant (or just relies on the new constant's name reflecting what we want the graphql_name to be). This seems needlessly laborious to me though.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing GraphQL::Enterprise::Changeset::Modification and the modifies DSL to see how schema-member methods are exposed. Compare the requested graphql_name call with the existing Changeset API, then verify that a changeset can rename a type without raising the reported undefined-method error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, ruby
- Domain
- api
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100