Skip to content

Instantly share code, notes, and snippets.

@yogain123
Last active May 29, 2022 07:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yogain123/bf76148710c46fa321b39742df68d83c to your computer and use it in GitHub Desktop.
Save yogain123/bf76148710c46fa321b39742df68d83c to your computer and use it in GitHub Desktop.
Graphql Queries
@yogain123
Copy link
Author

yogain123 commented May 22, 2022

Queries

query{
    getUser{
        name,
        age
    }
}

query{
   getState(input:{name:"yogendra"}){
     name,
     age
  }
}


query getStateAndValidation($data:DATA!){
    getStates(input:$data){
        name,
        age
    }
}

variables:{
data:{
    name:"yogendra"
  }
}

@yogain123
Copy link
Author

yogain123 commented May 22, 2022

Mutation


mutation{
    updateDetails({
        taskKey:"contract"
    }){
        status
    }
}

mutation UpdateDetails($data:DATA!){
    updateDetails(registration:$data){
        status
    }
}

variables : {
    data:{taskKey:"contract"}
}

@yogain123
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment