Open capaj opened 6 years ago
Do you use compileSchema
function of typegql
to compile schema that is using this type? It should perform validation and do exactly what you're asking here.
Giving good error messages is really important for library like this. I'd appreciate if you'd describe steps to reproduce getting your error.
I just have this very basic project set up and I try most of the things there: https://github.com/capaj/type-gql-with-binding-boilerplate
Our production project is way to complex for experimenting like that. You can see I compile it here: https://github.com/capaj/type-gql-with-binding-boilerplate/blob/3ad576184fbdf405cf4445f1340728d3064a0947/index.ts#L55
and I run it using https://github.com/capaj/type-gql-with-binding-boilerplate/blob/3ad576184fbdf405cf4445f1340728d3064a0947/package.json#L7
I don't have the async field there, but you can easily just copu paste this field in there.
when I specify a field decorator such as this:
I get this error:
Which is fine-you need to specify the type explicitly using
{type: Number}
, but would it be possible to maybe at least print out a name of the field and the name of the class? It's quite hard to find where the error is coming from if I have just added many fields