Graphcool / graphcool-framework

Apache License 2.0
1.78k stars 130 forks source link

Field type Json has no validator defined #489

Open marktani opened 6 years ago

marktani commented 6 years ago

Current behavior

Importing data to services with a Json field doesn't work. The error message

Field type Json has no validator defined

is returned.

Reproduction

Import data to a service that has a field of type Json or Json!.

Expected behavior?

It works.

adrienbarreau commented 6 years ago

any update on this one ? Is there an other way import data ?

marcqualie commented 6 years ago

Also hitting this issue, essentially making it so Graphcool has no working backup system since we can't restore a backup in production due to this import error

GaelGRIFFON commented 6 years ago

Same issue here... I think you just have to add here: https://github.com/graphcool/graphcool-framework/blob/0b80d3a8988fbaf6d9d4b2d55f2d586bc5e19e43/cli/packages/graphcool-cli-core/src/commands/import/Validator.ts#L41

Json: (str) => {
    try {
        JSON.parse(str);
    } catch (e) {
        return false;
    }
    return true;
}

or something like that... (can't test here...)

Edit: PR #513

usulpro commented 6 years ago

Are there any workarounds? Will it work if I downgrage graphcool? Can't migrate my database to graphcool because of this :(