Skip to content

Commit b7b82f5

Browse files
committed
Updated API from documentation release
1 parent 473d2c6 commit b7b82f5

File tree

7 files changed

+117
-0
lines changed

7 files changed

+117
-0
lines changed

api-specs/history/api.raml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,24 @@ resourceTypes:
154154
type: string
155155
description: |
156156
`key` of the Project.
157+
/graphql:
158+
post:
159+
displayName: GraphQL
160+
description: Execute a GraphQL request.
161+
securedBy:
162+
- oauth_2_0:
163+
scopes:
164+
['view_audit_log:{projectKey}', 'view_categories:{projectKey}']
165+
body:
166+
application/json:
167+
example: !include examples/GraphQLRequest.json
168+
type: GraphQLRequest
169+
responses:
170+
200:
171+
body:
172+
application/json:
173+
example: !include examples/GraphQLResponse.json
174+
type: GraphQLResponse
157175
get:
158176
displayName: Query Records
159177
securedBy:
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"query": "query getCategoryChanges($startDate: DateFilterValue!, $endDate: DateFilterValue!){categories(date:{from:$startDate to:$endDate}) {results {type modifiedAt changes {previousValue nextValue change} resource{id} }}}",
3+
"operationName": "getCategoryChanges",
4+
"variables": {
5+
"startDate": "2024-09-07T08:53:28.471Z",
6+
"endDate": "2024-11-07T08:53:28.471Z"
7+
}
8+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"data": {
3+
"categories": {
4+
"results": [
5+
{
6+
"type": "ResourceUpdated",
7+
"modifiedAt": "2024-11-07T08:53:28.471Z",
8+
"changes": [
9+
{
10+
"previousValue": {
11+
"en": "Old name for Category"
12+
},
13+
"nextValue": {
14+
"en": "New name for Category"
15+
},
16+
"change": "changeName"
17+
}
18+
],
19+
"resource": {
20+
"id": "cd260fc9-c575-4ba3-8789-cc4c9980ee4e"
21+
}
22+
},
23+
{
24+
"type": "ResourceCreated",
25+
"modifiedAt": "2024-10-22T22:39:44.201Z",
26+
"changes": [],
27+
"resource": {
28+
"id": "ffae2221-40c4-410d-bd13-e0fa4b6a4dd6"
29+
}
30+
}
31+
]
32+
}
33+
}
34+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#%RAML 1.0 DataType
2+
(package): GraphQL
3+
displayName: GraphQLError
4+
type: object
5+
description: Contains an error message, the location of the code that caused the error, and other information to help you correct the error.
6+
properties:
7+
message:
8+
type: string
9+
description: Detailed description of the error explaining the root cause of the problem and suggesting how to correct the error.
10+
locations:
11+
type: array
12+
items: GraphQLErrorLocation
13+
description: Location within your query where the error occurred.
14+
path?:
15+
type: array
16+
items: any
17+
description: Query fields listed in order from the root of the query response up to the field in which the error occurred. `path` is displayed in the response only if an error is associated with a particular field in the query result.
18+
extensions:
19+
type: GraphQLErrorObject
20+
description: Dictionary with additional information where applicable.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#%RAML 1.0 DataType
2+
(package): GraphQL
3+
displayName: GraphQLRequest
4+
example: !include ../examples/GraphQLRequest.json
5+
description: The query, operation name, and variables that are sent to the GraphQL API.
6+
type: object
7+
properties:
8+
query:
9+
type: string
10+
description: String representation of the _Source Text_ of the _Document_ that is specified in the [Language section of the GraphQL specification](https://spec.graphql.org/draft/#sec-Language).
11+
operationName?:
12+
type: string
13+
description: Name of the operation, if you defined several operations in `query`.
14+
variables?:
15+
type: GraphQLVariablesMap
16+
description: JSON object that contains key-value pairs in which the keys are variable names and the values are variable values.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#%RAML 1.0 DataType
2+
(package): GraphQL
3+
displayName: GraphQLResponse
4+
type: object
5+
example: !include ../examples/GraphQLResponse.json
6+
description: |
7+
`error` is present in the response only if the GraphQL query was unsuccessful.
8+
properties:
9+
data?:
10+
type: any
11+
description: JSON object that contains the results of a GraphQL query.
12+
errors?:
13+
type: array
14+
items: GraphQLError
15+
description: Errors that the GraphQL query returns.

api-specs/history/types/types.raml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ Label: !include label/Label.raml
1313
LocalizedString: !include common/LocalizedString.raml
1414
ChangeTargetChangeValue: !include change/change-value/ChangeTargetChangeValue.raml
1515
ChangeValueChangeValue: !include change/change-value/ChangeValueChangeValue.raml
16+
GraphQLRequest: !include ../../api/types/graphql/GraphQLRequest.raml
17+
GraphQLResponse: !include ../../api/types/graphql/GraphQLResponse.raml
18+
GraphQLError: !include GraphQLError.raml
19+
GraphQLErrorLocation: !include ../../api/types/graphql/GraphQLErrorLocation.raml
20+
GraphQLVariablesMap: !include ../../api/types/graphql/GraphQLVariablesMap.raml
21+
GraphQLErrorObject: !include ../../api/types/error/graphql/GraphQLErrorObject.raml
1622
# Generated types
1723
AddAddressChange: !include change/AddAddressChange.raml
1824
AddAssetChange: !include change/AddAssetChange.raml

0 commit comments

Comments
 (0)