Skip to content

Commit f254d17

Browse files
committed
Updated API from documentation release
1 parent 3fb2376 commit f254d17

File tree

11 files changed

+41
-34
lines changed

11 files changed

+41
-34
lines changed
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
{
2-
"message": "Cannot query field 'aaa' on type 'PaymentQueryResult'",
2+
"message": "Object 35d33405-2d39-4528-b195-fa3ab6beb927 has a different version than expected. Expected: 1 - Actual: 2.",
3+
"path": ["deleteProduct"],
34
"locations": [
45
{
5-
"line": 3,
6-
"column": 16
6+
"line": 2,
7+
"column": 3
78
}
89
],
910
"extensions": {
10-
"code": "InvalidInput"
11+
"code": "ConcurrentModification",
12+
"currentVersion": 2
1113
}
1214
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ "productKey": "a-product-key" }
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"query": "\n query query_1($productId: String){\n product(key:$productId){\n key\n }\n }\n ",
3-
"operationName": "query_1",
4-
"variables": { "productId": "f8ded810-a1" }
2+
"query": "query getProductByKey($productKey: String!) { product(key: $productKey) { id version }}",
3+
"operationName": "getProductByKey",
4+
"variables": { "productKey": "a-product-key" }
55
}
Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,8 @@
11
{
22
"data": {
3-
"products": {
4-
"results": [
5-
{
6-
"id": "00f230ac-da51-4a18-99eb-83368f1435b1",
7-
"masterData": {
8-
"staged": {
9-
"skus": [
10-
"test"
11-
],
12-
"name": "Test"
13-
},
14-
"current": {
15-
"skus": [
16-
"test"
17-
],
18-
"name": "Test"
19-
}
20-
}
21-
}
22-
]
3+
"product": {
4+
"id": "35d33405-2d39-4528-b195-fa3ab6beb927",
5+
"version": 2
236
}
247
}
258
}

api-specs/api/resources/graphql.raml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ displayName: graphql
33
description: commercetools Composable Commerce provides a GraphQL API
44
post:
55
displayName: GraphQL
6-
description: Execute a GraphQL query
6+
description: Execute a GraphQL request.
77
securedBy: [oauth_2_0: { scopes: ['view_products:{projectKey}'] }]
88
body:
9-
application/graphql:
9+
application/json:
1010
example: !include ../examples/graphql-query.example.json
1111
type: GraphQLRequest
1212
responses:

api-specs/api/types/error/graphql/GraphQLErrorObject.raml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ properties:
88
code:
99
type: string
1010
description: |
11-
Error identifier.
11+
One of the error codes that is listed on the [Errors](/errors) page.
1212
//:
1313
type: any
1414
description: |

api-specs/api/types/graphql/GraphQLError.raml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,20 @@
22
(package): GraphQL
33
displayName: GraphQLError
44
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.
56
example: !include ../../examples/GraphQL/GraphQLError.json
67
properties:
78
message:
89
type: string
10+
description: Detailed description of the error explaining the root cause of the problem and suggesting how to correct the error.
911
locations:
1012
type: array
1113
items: GraphQLErrorLocation
14+
description: Location within your query where the error occurred.
1215
path?:
1316
type: array
1417
items: any
18+
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.
1519
extensions:
1620
type: GraphQLErrorObject
21+
description: Dictionary with additional information where applicable.

api-specs/api/types/graphql/GraphQLErrorLocation.raml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,13 @@
22
(package): GraphQL
33
displayName: GraphQLErrorLocation
44
type: object
5+
description: Represents the location within your query where the error occurred.
56
properties:
67
line:
7-
type: integer
8+
type: number
9+
format: int64
10+
description: Line number of the query where the error occurred.
811
column:
9-
type: integer
12+
type: number
13+
format: int64
14+
description: Position in `line` where the error occurred.
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
#%RAML 1.0 DataType
22
(package): GraphQL
33
displayName: GraphQLRequest
4+
example: !include ../../examples/graphql-query.example.json
5+
description: The query, operation name, and variables that are sent to the GraphQL API.
46
type: object
57
properties:
68
query:
79
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).
811
operationName?:
912
type: string
13+
description: Name of the operation, if you defined several operations in `query`.
1014
variables?:
1115
type: GraphQLVariablesMap
12-
description: ''
16+
description: JSON object that contains key-value pairs in which the keys are variable names and the values are variable values.

api-specs/api/types/graphql/GraphQLResponse.raml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,14 @@
22
(package): GraphQL
33
displayName: GraphQLResponse
44
type: object
5+
example: !include ../../examples/graphql.example.json
6+
description: |
7+
`error` is present in the response only if the GraphQL query was unsuccessful.
58
properties:
69
data?:
710
type: any
11+
description: JSON object that contains the results of a GraphQL query.
812
errors?:
913
type: array
1014
items: GraphQLError
11-
description: ''
15+
description: Errors that the GraphQL query returns.

0 commit comments

Comments
 (0)