added @request.context field

This commit is contained in:
Gani Georgiev
2024-02-17 15:01:09 +02:00
parent 6aaf98215d
commit a11abef84b
42 changed files with 79 additions and 43 deletions

View File

@@ -89,6 +89,7 @@ func NewRecordFieldResolver(
loadedCollections: []*models.Collection{baseCollection},
allowedFields: []string{
`^\w+[\w\.\:]*$`,
`^\@request\.context$`,
`^\@request\.method$`,
`^\@request\.auth\.[\w\.\:]*\w+$`,
`^\@request\.data\.[\w\.\:]*\w+$`,
@@ -100,6 +101,7 @@ func NewRecordFieldResolver(
r.staticRequestInfo = map[string]any{}
if r.requestInfo != nil {
r.staticRequestInfo["context"] = r.requestInfo.Context
r.staticRequestInfo["method"] = r.requestInfo.Method
r.staticRequestInfo["query"] = r.requestInfo.Query
r.staticRequestInfo["headers"] = r.requestInfo.Headers