Skip to content

Commit 6e6591e

Browse files
committed
👽 Ignore invalid GraphQL field name
1 parent aa28811 commit 6e6591e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

schema.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,15 @@ module.exports = function buildSchema({appId, appKey, masterKey}) {
4545
'X-LC-Id': appId,
4646
'X-LC-Key': `${masterKey},master`
4747
}
48+
}).then( cloudSchemas => {
49+
return _.mapValues(cloudSchemas, (schema, className) => {
50+
return _.omitBy(schema, (definition, field) => {
51+
if (field.startsWith('__')) {
52+
console.error(`[leancloud-graphql] Ignored invalid GraphQL field name \`${className}.${field}\``);
53+
return true;
54+
}
55+
});
56+
});
4857
}).then( cloudSchemas => {
4958
const classes = _.mapValues(cloudSchemas, (schema, className) => {
5059
return AV.Object.extend(className);

0 commit comments

Comments
 (0)