Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add extensions property to all types and fields configs #623

Closed
SevInf opened this issue Feb 25, 2020 · 1 comment
Closed

Add extensions property to all types and fields configs #623

SevInf opened this issue Feb 25, 2020 · 1 comment

Comments

@SevInf
Copy link
Contributor

SevInf commented Feb 25, 2020

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.

@vladar
Copy link
Member

vladar commented Feb 26, 2020

It sounds like a duplicate of #588. Closing this to keep all context in a single issue.

@vladar vladar closed this as completed Feb 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants