Repository for checking fragment bugs in ent
docker-compose up -d
go run main.go
After inserting arbitrary data using mutation, use Query to retrieve the data using the ID of the data generated by mutation.
mutation {
createUser(input:{
name:"user",
email:"[email protected]"
password:"password"
}){
id
name
email
password
}
}
mutation {
createProject(input:{
name:"project"
userIDs:["{ID generated by createUser}"]
}){
id
name
users{
id
}
}
}
mutation {
createTask(input:{
name:"task"
description:"description"
status:todo
projectID:"{ID generated by createProject}"
}){
id
name
description
status
project{
id
users{
id
}
}
}
}
query {
canget:node(id:"{ID generated by createTask}"){
...on Task {
id
name
description
status
project{
id
name
users{
id
name
email
password
}
}
}
}
cannotget: node(id:"{ID generated by createTask}"){
...on Task {
id
name
description
status
project{
...ProjectFragment
users{
...UsersFragment
}
}
}
}
canGetGrandChild:node(id:"{ID generated by createTask}"){
...on Task {
id
name
description
status
project{
...ProjectFragmentWithUser
}
}
}
canGetNotNode:tasks{
id
name
description
status
project{
...ProjectFragment
users{
...UsersFragment
}
}
}
}
fragment ProjectFragment on Project{
id
name
}
fragment UsersFragment on User {
id
name
email
password
}
fragment ProjectFragmentWithUser on Project {
id
name
users {
id
name
email
password
}
}