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; options.subqueryReadPreference = subqueryReadPreference;
} }
return await rest.find( return rest.find(config, auth, className, where, options, info.clientSDK);
config,
auth,
className,
where,
options,
info.clientSDK
);
}; };
export { getObject, findObjects }; export { getObject, findObjects };

View File

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

View File

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

View File

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