-
Notifications
You must be signed in to change notification settings - Fork 0
/
CreateCollectionLocationWithExternalReference.graphql
54 lines (53 loc) · 1.9 KB
/
CreateCollectionLocationWithExternalReference.graphql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Creates a collection location with a reference to an external primary key
# reference, so that we can track ID's to synchronize data between platforms.
# We leverage a named attribute that is supported for querying items and
# obtaining locations from a collection based on their external references.
mutation createCollectionLocationWithExternalReference(
$collectionId: ID!
$title: String!
$longitude: Float!
$latitude: Float!
$placeId: ID
# String Value
$externalId: JSON!
# String Value
$externalSource: JSON!
) {
# use the standard createCollectionLocation
createCollectionLocation(
# Supply the collection to place the location within
collectionId: $collectionId
# Supply the collection location
location: {
# Content about the location
title: $title
# Supply the place data
place: {
# Supply the place position coordinates (mandatory)
position: { lon: $longitude, lat: $latitude }
# Optionally relate to a known place, such as a place from ATDW if you
# are leveraging place information to be updated automatically without
# a re-import.
id: $placeId
}
# Leverage Attributes to extend the data stored and accessible for the
# location
attrs: [
# Track the ID from my platform into the "custom://external-id". This
# is a recognised attribute that can be later used to find the matching
# collection location based on your own IDs
{ id: "custom://external-id", value: $externalId }
# Support for external sources, also for grouping together multiple
# different sources. Can be used to query all records from a specific
# source later using the query collectionItems()
{ id: "custom://external-source", value: $externalSource }
]
}
) {
# Confirm the ID that is created
location {
id
__typename
}
}
}