This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
builder.Services.AddControllers().AddJsonOptions(options => | |
options.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter()) | |
).ConfigureApiBehaviorOptions(option => | |
{ | |
option.InvalidModelStateResponseFactory = context => | |
{ | |
string errorInfo = string.Empty; | |
try | |
{ | |
if (context.ModelState.Count > 0 && context.ModelState.First().Value != null && context.ModelState.First().Value?.Errors.Count > 0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FlurlHttp.Configure(settings => settings.BeforeCall = (FlurlCall call) => | |
{ | |
app.Logger.LogInformation($"Calling {call.Request.Url} with {call.RequestBody}"); | |
}); | |
FlurlHttp.Configure(settings => settings.OnError = (FlurlCall call) => | |
{ | |
app.Logger.LogError(call.Exception, $"Error calling {call.Request.Url}"); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
query MyQuery($datasource: String!, $language: String!) { | |
datasource: item(path: $datasource, language: $language) { | |
# List 20 children of given template under given datasource | |
children( | |
first: 20 | |
includeTemplateIDs: "{A6DDAC75-7D24-4BDB-B3F6-5F47FBB21379}" | |
# after: "endCursor" (see endCursor below) | |
# hasLayout: true | |
) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
query MyQuery($datasource: String!, $language: String!) { | |
datasource: item(path: $datasource, language: $language) { | |
# List children of given datasource | |
children { | |
results { | |
id | |
name | |
field(name: "MyCustomField") { | |
jsonValue | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Meta": { | |
"Page": 1, | |
"PageSize": 20, | |
"TotalCount": 2, | |
"TotalPages": 1, | |
"ItemRange": [ | |
1, | |
2 | |
], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Meta": { | |
"Page": 1, | |
"PageSize": 20, | |
"TotalCount": 3, | |
"TotalPages": 1, | |
"ItemRange": [ | |
1, | |
3 | |
], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Meta": { | |
"Page": 1, | |
"PageSize": 20, | |
"TotalCount": 2, | |
"TotalPages": 1, | |
"ItemRange": [ | |
1, | |
2 | |
], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Meta": { | |
"Page": 1, | |
"PageSize": 20, | |
"TotalCount": 3, | |
"TotalPages": 1, | |
"ItemRange": [ | |
1, | |
3 | |
], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Headers": { | |
"type": "sitecore.ordercloud.messages.product.updated", | |
"marketplace": "yourMarketplaceId", | |
"tenantid": "yourMarketplaceId" | |
}, | |
"Payload": { | |
"UserContext": { | |
"ID": null, | |
"AnonymousID": null |
NewerOlder