Skip to content

JSON Schema incompatible with Relay Compiler #150

@ste93cry

Description

@ste93cry
Q A
Bug report? no
Feature request? yes
BC Break report? yes
RFC? no
Version/Branch master

Although I could not find a official specification on the topic, the official babel-plugin-relay plugin from Facebook (Relay Modern) expects the JSON schema to be enclosed in a data object. This is what is generated from the graphql:dump-schema:

{
    "__schema": {}
}

And this is what the plugin expects:

{
    "data": {
        "__schema": {}
    }
}

The problem relies at GraphQLDumpSchemaCommand#82 where the json_encode function is applied on the data element instead of the $result variable itself. Changing this would indeed be a BC break, but at the moment the JSON schema is unusable with the Relay Modern compiler

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions