Last active
July 17, 2022 18:59
-
-
Save mugan86/385e6dc0c6355dae3d0ddb3ae47f8e39 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
countUsers | |
users (page: 1) { | |
status | |
message | |
list { | |
id | |
name | |
lastname | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
query UsersPages{ | |
usersPageOne: users(page: 1, itemsPerPage: 10) { | |
...ResultFragment | |
} | |
usersPageTwo: users(page: 23, itemsPerPage: 10) { | |
...ResultFragment | |
} | |
} | |
fragment ResultFragment on UserData { | |
status | |
message | |
list{ | |
...UserFragment | |
} | |
item{ | |
...UserFragment | |
} | |
} | |
fragment UserFragment on User { | |
id | |
name | |
lastname | |
avatar | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Usamos para mostrar la lista o no, dependiendo del caso | |
query UsersPages($list: Boolean!, $itemsPerPage: Int){ | |
usersPageOne: users (page: 1, itemsPerPage: $itemsPerPage) { | |
...ResultFragment | |
} | |
usersPageTwo: users (page: 2) { | |
...ResultFragment | |
} | |
} | |
fragment ResultFragment on UserData { | |
status | |
message | |
list @include(if: $list) { | |
...UserFragment | |
} | |
item @skip(if: $list){ | |
...UserFragment | |
} | |
} | |
fragment UserFragment on User { | |
id | |
name | |
lastname | |
avatar @skip(if: $list) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
query UsersDetails($list: Boolean!){ | |
countUsers | |
samuel: user(id: 56) { | |
...ResultFragment | |
} | |
carry: user(id: 42) { | |
...ResultFragment | |
} | |
notFound: user(id: 5968) { | |
...ResultFragment | |
} | |
} | |
fragment ResultFragment on Result { | |
status | |
message | |
list @include(if: $list) { | |
...UserFragment | |
} | |
item @skip(if: $list){ | |
...UserFragment | |
} | |
} | |
fragment UserFragment on User { | |
id | |
name | |
lastname | |
avatar @skip(if: $list) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mutation Connect($connectId: Int!, $connect: Boolean!) { | |
connect(id: $connectId, connect: $connect) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
query logConnectionsPages { | |
countLogsConnections | |
logConnections (page: 1, itemsPerPage: 2){ | |
status | |
message | |
list { | |
id | |
user | |
connect | |
data | |
location { | |
lat | |
lng | |
} | |
} | |
} | |
} | |
// Añadimos los fragments para | |
// reducir la consulta y así añadir varias | |
// sin repetir lo mismos una y otra vez |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment