Remove error field from query

This commit is contained in:
Christian Cueni 2020-04-30 08:57:47 +02:00
parent d46cc7a177
commit ebc8d070f6
5 changed files with 7 additions and 50 deletions

View File

@ -1,5 +1,4 @@
{
"__schema": {
"queryType": {
"name": "Query"
@ -174,22 +173,6 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "errors",
"description": null,
"args": [],
"type": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "OBJECT",
"name": "RegistrationError",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "clientMutationId",
"description": null,
@ -228,29 +211,6 @@
"enumValues": null,
"possibleTypes": null
},
{
"kind": "OBJECT",
"name": "RegistrationError",
"description": null,
"fields": [
{
"name": "field",
"description": null,
"args": [],
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
}
],
"inputFields": null,
"interfaces": [],
"enumValues": null,
"possibleTypes": null
},
{
"kind": "INPUT_OBJECT",
"name": "RegistrationInput",
@ -258,7 +218,7 @@
"fields": null,
"inputFields": [
{
"name": "confirmationKeyInput",
"name": "confirmationKey",
"description": null,
"type": {
"kind": "SCALAR",
@ -268,7 +228,7 @@
"defaultValue": null
},
{
"name": "userIdInput",
"name": "userId",
"description": null,
"type": {
"kind": "SCALAR",

View File

@ -2,8 +2,5 @@ mutation Registration($input: RegistrationInput!) {
registration(input: $input) {
success
message
errors {
field
}
}
}

View File

@ -37,8 +37,8 @@ export default {
client: 'publicClient',
variables: {
input: {
confirmationKeyInput: this.$route.query.confirmation,
userIdInput: this.$route.query.id
confirmationKey: this.$route.query.confirmation,
userId: this.$route.query.id
}
},
fetchPolicy: 'no-cache'

View File

@ -19,7 +19,7 @@ from users.user_signup_login_handler import handle_user_and_verify_products, UNK
class Registration(relay.ClientIDMutation):
class Input:
confirmation_key = graphene.String()
user_id_input = graphene.Int()
user_id = graphene.Int()
success = graphene.Boolean()
message = graphene.String()
@ -28,7 +28,7 @@ class Registration(relay.ClientIDMutation):
@classmethod
def mutate_and_get_payload(cls, root, info, **kwargs):
confirmation_key = kwargs.get('confirmation_key')
user_id = kwargs.get('user_id_input')
user_id = kwargs.get('user_id')
hep_client = HepClient()
admin_token = AdminData.objects.get_admin_token()

View File

@ -53,7 +53,7 @@ class RegistrationTests(TestCase):
return self.client.execute(mutation, variables={
'input': {
'confirmationKey': confirmation_key,
'userIdInput': user_id
'userId': user_id
}
})