Property Group Mutation
Create or update property groups in EverReal
Mutation Types
type Mutation {
upsertPropertyGroup(propertyGroup: PropertyGroupInput!): PropertyGroup!
}Here are details on the capabilities of different mutations
The
upsertPropertyGroupthe mutation is used to create or update a property group in the EverReal system and property added to the system cannot be modified by Everreal and if needs to be modified it should be done via the same endpoint itself.
Schema Definition
items with ! notation are required
input PropertyGroupInput {
name: String
externalPropertyGroupId: String!
descriptions: PropertyGroupDescriptionInput
}
input PropertyGroupDescriptionInput {
object: String
amenities: String
location: String
other: String
}
externalPropertyGroupIdis required field, this is thekeyor theidwhich is used by the 3d party system(data synchronize between 3rd party)
Below we are providing a full example how to create or update a property, all this information is not required, only the ones that was using ! notation previously.
mutation {
upsertPropertyGroup(
propertyGroup: {
name: "Ray - PG1"
externalPropertyGroupId: "RPG-1"
descriptions:{
object: "Sample - Object"
amenities: "Sample - Amenities"
location: "Sample - Location"
other: "Sample - Other"
}
}
) { id }
}var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer ....");
myHeaders.append("Content-Type", "application/json");
var graphql = JSON.stringify({
query: "mutation {\n upsertPropertyGroup(\n propertyGroup: {\n name: \"Ray - PG1\"\n externalPropertyGroupId: \"RPG-1\"\n descriptions:{\n object: \"Sample - Object\"\n amenities: \"Sample - Amenities\"\n location: \"Sample - Location\"\n other: \"Sample - Other\"\n }\n }\n ) { id }\n}",
variables: {}
})
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: graphql,
redirect: 'follow'
};
fetch("https://acme-qa.everreal-dev.co/api/reporting/graphql", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));Last updated
Was this helpful?