Skip to content

Commit

Permalink
Updated API from documentation release
Browse files Browse the repository at this point in the history
  • Loading branch information
ct-sdks[bot] committed Jan 2, 2025
1 parent 473d2c6 commit b7b82f5
Show file tree
Hide file tree
Showing 7 changed files with 117 additions and 0 deletions.
18 changes: 18 additions & 0 deletions api-specs/history/api.raml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,24 @@ resourceTypes:
type: string
description: |
`key` of the Project.
/graphql:
post:
displayName: GraphQL
description: Execute a GraphQL request.
securedBy:
- oauth_2_0:
scopes:
['view_audit_log:{projectKey}', 'view_categories:{projectKey}']
body:
application/json:
example: !include examples/GraphQLRequest.json
type: GraphQLRequest
responses:
200:
body:
application/json:
example: !include examples/GraphQLResponse.json
type: GraphQLResponse
get:
displayName: Query Records
securedBy:
Expand Down
8 changes: 8 additions & 0 deletions api-specs/history/examples/GraphQLRequest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"query": "query getCategoryChanges($startDate: DateFilterValue!, $endDate: DateFilterValue!){categories(date:{from:$startDate to:$endDate}) {results {type modifiedAt changes {previousValue nextValue change} resource{id} }}}",
"operationName": "getCategoryChanges",
"variables": {
"startDate": "2024-09-07T08:53:28.471Z",
"endDate": "2024-11-07T08:53:28.471Z"
}
}
34 changes: 34 additions & 0 deletions api-specs/history/examples/GraphQLResponse.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"data": {
"categories": {
"results": [
{
"type": "ResourceUpdated",
"modifiedAt": "2024-11-07T08:53:28.471Z",
"changes": [
{
"previousValue": {
"en": "Old name for Category"
},
"nextValue": {
"en": "New name for Category"
},
"change": "changeName"
}
],
"resource": {
"id": "cd260fc9-c575-4ba3-8789-cc4c9980ee4e"
}
},
{
"type": "ResourceCreated",
"modifiedAt": "2024-10-22T22:39:44.201Z",
"changes": [],
"resource": {
"id": "ffae2221-40c4-410d-bd13-e0fa4b6a4dd6"
}
}
]
}
}
}
20 changes: 20 additions & 0 deletions api-specs/history/types/GraphQLError.raml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#%RAML 1.0 DataType
(package): GraphQL
displayName: GraphQLError
type: object
description: Contains an error message, the location of the code that caused the error, and other information to help you correct the error.
properties:
message:
type: string
description: Detailed description of the error explaining the root cause of the problem and suggesting how to correct the error.
locations:
type: array
items: GraphQLErrorLocation
description: Location within your query where the error occurred.
path?:
type: array
items: any
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.
extensions:
type: GraphQLErrorObject
description: Dictionary with additional information where applicable.
16 changes: 16 additions & 0 deletions api-specs/history/types/GraphQLRequest.raml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#%RAML 1.0 DataType
(package): GraphQL
displayName: GraphQLRequest
example: !include ../examples/GraphQLRequest.json
description: The query, operation name, and variables that are sent to the GraphQL API.
type: object
properties:
query:
type: string
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).
operationName?:
type: string
description: Name of the operation, if you defined several operations in `query`.
variables?:
type: GraphQLVariablesMap
description: JSON object that contains key-value pairs in which the keys are variable names and the values are variable values.
15 changes: 15 additions & 0 deletions api-specs/history/types/GraphQLResponse.raml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#%RAML 1.0 DataType
(package): GraphQL
displayName: GraphQLResponse
type: object
example: !include ../examples/GraphQLResponse.json
description: |
`error` is present in the response only if the GraphQL query was unsuccessful.
properties:
data?:
type: any
description: JSON object that contains the results of a GraphQL query.
errors?:
type: array
items: GraphQLError
description: Errors that the GraphQL query returns.
6 changes: 6 additions & 0 deletions api-specs/history/types/types.raml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ Label: !include label/Label.raml
LocalizedString: !include common/LocalizedString.raml
ChangeTargetChangeValue: !include change/change-value/ChangeTargetChangeValue.raml
ChangeValueChangeValue: !include change/change-value/ChangeValueChangeValue.raml
GraphQLRequest: !include ../../api/types/graphql/GraphQLRequest.raml
GraphQLResponse: !include ../../api/types/graphql/GraphQLResponse.raml
GraphQLError: !include GraphQLError.raml
GraphQLErrorLocation: !include ../../api/types/graphql/GraphQLErrorLocation.raml
GraphQLVariablesMap: !include ../../api/types/graphql/GraphQLVariablesMap.raml
GraphQLErrorObject: !include ../../api/types/error/graphql/GraphQLErrorObject.raml
# Generated types
AddAddressChange: !include change/AddAddressChange.raml
AddAssetChange: !include change/AddAssetChange.raml
Expand Down

0 comments on commit b7b82f5

Please sign in to comment.