Describe the bug
a.customType() currently allows users to set authorization on fields, but when this is deployed no resolver is created and no error is displayed.
To Reproduce
const schema = a.schema({
Post: a.customType({
id: a.id().required(),
title: a.string().required(),
// I would expect this field to have a resolver and to be omitted if not logged in
description: a.string()
.authorization((allow) => allow.authenticated()),
}),
searchForPosts: a
.query()
.arguments({
search: a.string(),
})
.returns(a.ref('Post').required().array().required())
.handler(
a.handler.function(defineFunction({
entry: './posts/search.ts',
}))
),
})
.authorization((allow) => allow.publicApiKey());
Expected behavior
Either:
- (Preferred) An appropriate field resolver to be created, and for the field to be null when not authorized.
- (Less preferred) Not able to call
.authorization on a customType
Desktop (please complete the following information):
Additional context
Switching .customType to .model causes the resolver to be created (but also creates a db table that are unnecessary)
Describe the bug
a.customType()currently allows users to set authorization on fields, but when this is deployed no resolver is created and no error is displayed.To Reproduce
Expected behavior
Either:
.authorizationon a customTypeDesktop (please complete the following information):
Additional context
Switching
.customTypeto.modelcauses the resolver to be created (but also creates a db table that are unnecessary)