This is a demo for Moqui GraphQl
This demo depends on:
git clone https://github.com/moqui/moqui-framework
cd moqui-framework
./gradlew getRuntime
git clone https://github.com/shendepu/moqui-graphql ./runtime/component/moqui-graphql
git clone https://github.com/shendepu/moqui-graphql-demo ./runtime/component/mqoui-graphql-demo
./gradlew run
First open http://localhost:8080 and login with john.deo test account
then open http://localhost:8080/graphql/GraphiQL
input
query QueryType($showUsers: Boolean!) {
moqui {
users (pagination: {pageSize: 2}) @include(if: $showUsers) {
edges {
node {
userId
username
emailAddress
}
}
}
user(userId: "EX_JOHN_DOE") {
userId
username
userFullName
}
entity {
syncs {
edges {
node {
entitySyncId
}
}
}
}
basic {
geos (pagination: {pageSize: 4 }) {
edges {
node {
geoId
geoName
}
}
pageInfo {
totalCount
}
}
}
}
}
also add query variables
{
"showUsers": true
}
mutation {
graphqlDemo {
createPerson (input:{
firstName: "Dummy"
lastName: "Dude"
}) {
id
partyId
partyTypeEnumId
... on Person {
firstName
lastName
}
}
}
}
You may try modifying the query to see different result