Skip to content

Schema Type Inference #2

@DrewRidley

Description

@DrewRidley

Hi!

First of all, thank you for your work developing this type generator! It makes it possible to catch errors across a large codebase much easier, especially in CI/CD workflows.

The documentation mentions some examples where you can 'cast' the provided variables to the desired type. This is reflected upstream in the typescript definitions. In my experienced with a rust based type-generator, I found it is possible within UPDATE, CREATE and other statements, to infer the type at compile time.

For example if I did UPDATE $user SET email = $email, it can infer the required type of email as a string, because the field email is defined as a string in the schema.

This would reduce a lot of boilerplate while maintaining the same if not a higher safety margin on static typing.

Let me know your thoughts, and thanks again for your work on this project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions