0

What could be wrong in the below query, I get an Expected argument name error when I execute the query inside of Flutter. I tried another query which does not take any arguments which worked but not this one. Here is the post that I created in github regarding the same issue - https://github.com/zino-hofmann/graphql-flutter/discussions/1326

const String findContacts = r''' {
  query GetContacts($contacts:[String]){
    findContacts(contacts:$contacts) {
      status
      error
      users {
          id
          userPhoneNumber
          userDisplayName
      }
    }
  }
}
''';

Here is my schema -

type_defs = gql("""
    type Query {
        findContacts(contacts: [String]): Result!
    }


    type User {
        id: ID!
        partitionKey: String 
        userPhoneNumber: ID      
        userDisplayName: String
        avatarUrl: String
        createdAt: String 
        updatedAt: String
        userStatus: String
        userCustomMessage: String
    } 

    type Result {
        status: Int
        error: String
        user: User
        users: [User]
    }
""")
1
  • Is there anybody who can help me with this issue please? Commented May 19, 2023 at 2:32

1 Answer 1

0

This worked for me by setting setting the findContacts like below -

const String findContacts = """
  query(\$contacts:[String]) {
    findContactsOnBol(contacts:\$contacts) {
      status
      error
      users {
          id
          userPhoneNumber
          userDisplayName
      }
    }
  }
""";
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.