Skip to content

Add extensions property to all types and fields configs #623

Closed
@SevInf

Description

@SevInf

For example:

<?php
return new ObjectType([
    'name' => 'MyType',
    'extensions' => [
        'someTypeProperty' => 'value'
    ],
    'fields' => [
        [
            'name' => 'myField',
            ...
            'extensions' => [
                'someFieldProperty' => 'value'
            ]
        ]
    ]
])

graphql-js did it in graphql/graphql-js#2097.

This is a convenient way to add additional metadata for fields and types and access this data in the resolver. To the extent, it will work right now because 'graphql-php' allows to add custom properties, but in won't work in 100% cases. For example, SchemaExtender class will erase all non-standard properties on the config.

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