laravel-graphql icon indicating copy to clipboard operation
laravel-graphql copied to clipboard

Types Specified in Schema section of config without names are loaded incorrectly

Open sburba opened this issue 6 years ago • 0 comments

If you load a schema like this:

$schema = GraphQL::schema([
    'query' => [
        'examplesCustom' => ExamplesQuery::class
    ],
    'mutation' => [
        'updateExampleCustom' => UpdateExampleMutation::class
    ],
    'types' => [
        Type1::class,
        Type2::class
    ]
]);

The second type will be loaded with a name of "1" because in Folklore\GraphQL.php:70 the type loader doesn't check if the name variable is numeric before passing it to addType

sburba avatar Aug 01 '18 13:08 sburba