Change ACL to Non null (#6249)

This commit is contained in:
Antoine Cormouls
2019-12-02 05:46:06 +01:00
committed by Antonio Davi Macedo Coelho de Castro
parent 4435154cf9
commit 62459962dd
5 changed files with 73 additions and 207 deletions

264
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -115,14 +115,7 @@ const findObjects = async (
options.subqueryReadPreference = subqueryReadPreference;
}
return await rest.find(
config,
auth,
className,
where,
options,
info.clientSDK
);
return rest.find(config, auth, className, where, options, info.clientSDK);
};
export { getObject, findObjects };

View File

@@ -623,6 +623,10 @@ const PARSE_OBJECT_FIELDS = {
...CREATE_RESULT_FIELDS,
...UPDATE_RESULT_FIELDS,
...INPUT_FIELDS,
ACL: {
type: new GraphQLNonNull(ACL),
resolve: ({ ACL }) => (ACL ? ACL : { '*': { read: true, write: true } }),
},
};
const PARSE_OBJECT = new GraphQLInterfaceType({

View File

@@ -368,7 +368,6 @@ const load = (
limit: defaultGraphQLTypes.LIMIT_ATT,
options: defaultGraphQLTypes.READ_OPTIONS_ATT,
};
const classGraphQLOutputTypeName = `${graphQLClassName}`;
const outputFields = () => {
return classOutputFields.reduce((fields, field) => {

View File

@@ -56,7 +56,7 @@ const transformOutputTypeToGraphQL = (
case 'Bytes':
return defaultGraphQLTypes.BYTES;
case 'ACL':
return defaultGraphQLTypes.ACL;
return new GraphQLNonNull(defaultGraphQLTypes.ACL);
default:
return undefined;
}