remove createUser mutation
This commit is contained in:
@@ -1,16 +0,0 @@
|
||||
# frozen_string_literal: true
|
||||
module Mutations
|
||||
class CreateUser < BaseMutation
|
||||
field :success, Boolean, null: false
|
||||
|
||||
argument :user, Inputs::UserAttributesInput, required: true
|
||||
|
||||
def resolve(user:)
|
||||
User.create!({ **user, email: context[:current_auth].email })
|
||||
|
||||
{ success: true }
|
||||
rescue ActiveRecord::RecordInvalid => e
|
||||
{ success: false, errors: [e.message] }
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,6 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
module Types
|
||||
class MutationType < Types::BaseObject
|
||||
field :create_user, mutation: Mutations::CreateUser
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# frozen_string_literal: true
|
||||
class XStakeSchema < GraphQL::Schema
|
||||
mutation(Types::MutationType)
|
||||
# mutation(Types::MutationType)
|
||||
query(Types::QueryType)
|
||||
|
||||
def self.resolve_type(abstract_type, obj, ctx)
|
||||
|
||||
41
app/javascript/__generated__/schema.graphql
generated
41
app/javascript/__generated__/schema.graphql
generated
@@ -1,39 +1,3 @@
|
||||
"""
|
||||
Autogenerated input type of CreateUser
|
||||
"""
|
||||
input CreateUserInput {
|
||||
"""
|
||||
A unique identifier for the client performing the mutation.
|
||||
"""
|
||||
clientMutationId: String
|
||||
user: UserAttributesInput!
|
||||
}
|
||||
|
||||
"""
|
||||
Autogenerated return type of CreateUser
|
||||
"""
|
||||
type CreateUserPayload {
|
||||
"""
|
||||
A unique identifier for the client performing the mutation.
|
||||
"""
|
||||
clientMutationId: String
|
||||
|
||||
"""
|
||||
Errors encountered during execution of the mutation.
|
||||
"""
|
||||
errors: [String!]
|
||||
success: Boolean!
|
||||
}
|
||||
|
||||
type Mutation {
|
||||
createUser(
|
||||
"""
|
||||
Parameters for CreateUser
|
||||
"""
|
||||
input: CreateUserInput!
|
||||
): CreateUserPayload
|
||||
}
|
||||
|
||||
type Query {
|
||||
currentUser: User
|
||||
}
|
||||
@@ -45,8 +9,3 @@ type User {
|
||||
id: ID!
|
||||
lastName: String!
|
||||
}
|
||||
|
||||
input UserAttributesInput {
|
||||
firstName: String!
|
||||
lastName: String!
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user