adam
01/23/2018, 9:40 PMtype Tweet {
id: ID! @unique
createdAt: DateTime!
text: String!
owner: User!
location: Location!
}
type User {
id: ID! @unique
createdAt: DateTime!
updatedAt: DateTime!
handle: String! @unique
name: String
tweets: [Tweet!]!
}
type Location {
latitude: Float!
longitude: Float!
}
and I'm having some issue. When I update user location few times (via location > create
mutation as there is no other way), and then I query for locations
I'm having many location
zombie data rows and it's not possible to remove them. Is that issue or I'm doing something wrong?harmony
01/23/2018, 9:41 PMadam
01/23/2018, 9:42 PMadam
01/23/2018, 9:43 PMadam
01/23/2018, 9:43 PMdeleteManyLocations
mutationadam
01/23/2018, 9:44 PMupdate
location of some tweet, I dont really want to ‘clean’ after myself. Goal was to update location, not to create new location
rowadam
01/23/2018, 9:45 PMmutation {
updateTweet(data: {
location: {
create: {
latitude: 10,
longitude: 10
}
}
}, where: {
id: "cjcs5tn80000u0113h5fzxp2y"
}) {
id
}
}
adam
01/23/2018, 9:45 PMlocations
I getadam
01/23/2018, 9:46 PM{
"data": {
"locations": [
{
"longitude": 234,
"latitude": 34
},
{
"longitude": 11,
"latitude": 11
},
{
"longitude": 11,
"latitude": 11
},
{
"longitude": 11,
"latitude": 11
},
{
"longitude": 11,
"latitude": 11
},
{
"longitude": 10,
"latitude": 10
},
{
"longitude": 10,
"latitude": 10
},
{
"longitude": 10,
"latitude": 10
},
{
"longitude": 10,
"latitude": 10
},
{
"longitude": 10,
"latitude": 10
},
{
"longitude": 10,
"latitude": 10
},
{
"longitude": 10,
"latitude": 10
},
{
"longitude": 10,
"latitude": 10
},
{
"longitude": 10,
"latitude": 10
},
{
"longitude": 10,
"latitude": 10
},
{
"longitude": 10,
"latitude": 10
},
{
"longitude": 10,
"latitude": 10
},
{
"longitude": 10,
"latitude": 10
},
{
"longitude": 10,
"latitude": 10
},
{
"longitude": 10,
"latitude": 10
},
{
"longitude": 10,
"latitude": 10
},
{
"longitude": 10,
"latitude": 10
},
{
"longitude": 10,
"latitude": 10
},
{
"longitude": 10,
"latitude": 10
}
]
}
}
adam
01/23/2018, 9:46 PMadam
01/23/2018, 9:46 PMadam
01/23/2018, 9:48 PMharmony
01/23/2018, 9:56 PMharmony
01/23/2018, 9:56 PMharmony
01/23/2018, 9:57 PMharmony
01/23/2018, 9:57 PMadam
01/23/2018, 9:59 PMadam
01/23/2018, 9:59 PMadam
01/23/2018, 10:00 PMcreate
in uni-directional relation I’d say is not needed hereadam
01/23/2018, 10:05 PMadam
01/23/2018, 10:06 PMharmony
01/23/2018, 10:11 PMadam
01/23/2018, 10:11 PMadam
01/23/2018, 10:19 PMadam
01/23/2018, 10:19 PMcreate
even needed in uni-directional relations instead of
mutation {
updateTweet(data: {
location: {
lat: 20
}
}, where: {
id: 'ID HERE'
})
}
harmony
01/23/2018, 10:20 PMharmony
01/23/2018, 10:25 PM