Skip to content

Latest commit

 

History

History
43 lines (39 loc) · 1.23 KB

3.md

File metadata and controls

43 lines (39 loc) · 1.23 KB

Pet Library

Query to view details

query {
    allPets {
        name
        weight
        category
        inCareOf {
            name
        }
    }
}

Creating an account in Pet-Library using in-line input

mutation {                                      # Modification request
    createAccount (input: {                     # Input added directly
        name: "Allen Ben"
        username: "allenalvin333"
        password: "allenalvin333"
    }) 
    {                                           # Output displays 2 fields
        username
        name
    }
}

Creating an account in Pet-Library using variable input

mutation ($input: CreateAccountInput!) {        # Modification request with compulsory parameter
    createAccount (input: $input)               # Input added from variable
    {                                           # Output displays 2 fields
        username
        name
    }
}

{                                               # JSON object
    "input": {  
        "name": "Alvin Ben",
        "username": "alvinallen333",
        "password": "alvinallen333"
    }
}