chore: opt out of caching getGraphql and getFieldSchemaMap
This commit is contained in:
@@ -51,6 +51,10 @@ if (!cached) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const getGraphql = async (config: Promise<SanitizedConfig> | SanitizedConfig) => {
|
export const getGraphql = async (config: Promise<SanitizedConfig> | SanitizedConfig) => {
|
||||||
|
if (process.env.NODE_ENV === 'development') {
|
||||||
|
cached = global._payload_graphql = { graphql: null, promise: null }
|
||||||
|
}
|
||||||
|
|
||||||
if (cached.graphql) {
|
if (cached.graphql) {
|
||||||
return cached.graphql
|
return cached.graphql
|
||||||
}
|
}
|
||||||
@@ -110,7 +114,7 @@ export const POST =
|
|||||||
}
|
}
|
||||||
return response
|
return response
|
||||||
},
|
},
|
||||||
schema: schema,
|
schema,
|
||||||
validationRules: (request, args, defaultRules) => defaultRules.concat(validationRules(args)),
|
validationRules: (request, args, defaultRules) => defaultRules.concat(validationRules(args)),
|
||||||
})(originalRequest)
|
})(originalRequest)
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ if (!cached) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const getFieldSchemaMap = (config: SanitizedConfig): FieldSchemaMap => {
|
export const getFieldSchemaMap = (config: SanitizedConfig): FieldSchemaMap => {
|
||||||
if (cached) {
|
if (cached && process.env.NODE_ENV !== 'development') {
|
||||||
return cached
|
return cached
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user