0

I'm trying to implement mutation query with an array as a parameter and String as a return type.

Here is my schema file:

input OrganizationInput {
    orgId: String!
    orgName: String!
}
type Mutations {
     importOrganizations(input: [OrganizationInput]): String
}

Here is my mutation:

mutation importOrganizations($orgs: [OrganizationInput]) {
    importOrganizations(
        input: {
            orgId: id,
            orgName: name
        }
    )
}

This code doesn't work, but I don't know how to do it properly.

Maybe someone more experienced in GraphQL could help me?

1 Answer 1

1

Do you have any errors that can help?

Anyways your mutation need to return fields, e.g.:

mutation importOrganizations($orgs: [OrganizationInput]) {
    importOrganizations(
        input: {
            orgId: id,
            orgName: name
            })
        {
            id
            name
        }
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.