-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Introduced support of custom scalar types for GraphQL schema #34651
Introduced support of custom scalar types for GraphQL schema #34651
Conversation
minor fix of graphql controller
Hi @akaplya. Thank you for your contribution
❗ Automated tests can be triggered manually with an appropriate comment:
You can find more information about the builds here ℹ️ Run only required test builds during development. Run all test builds before sending your pull request for review. For more details, review the Magento Contributor Guide documentation. 🕙 You can find the schedule on the Magento Community Calendar page. 📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket. 🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel ✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel |
@mageno run all tests |
Just spotted this and this additional type will need to be considered when #31879 is reviewed. |
Hi @akaplya, Thank you for your contribution! Can you please resolve the conflicts in order to proceed further. Thank you! |
I have resolved the conflict and merged magento 2.4-develop |
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues. |
Hi @akaplya, This PR is causing too many test failures. In order to proceed further, we need a green build. Can you please have a look into these. |
@magento run WebAPI Tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues. |
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues. |
@magento run WebAPI Tests, Integration Tests, Static Tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues. |
Hello, Internal team has started to work on it. Thanks. |
As per this comment, moving it to On Hold. |
Moving this PR |
It seems that, this PR got merged in 0574ac2. Hence closing this now. |
Support for GraphQL custom scalars
This PR adds support for custom scalar types to GraphQL.
https://graphql.org/learn/schema/#scalar-types
https://webonyx.github.io/graphql-php/type-definitions/scalars/#writing-custom-scalar-types
After PR is merged a developer will be able to define custom scalar types and implementations by using Magento schema.
For example, the following declaration enables Json scalar type
Scalar type implementation should implement new
Magento\Framework\GraphQl\Schema\Type\Scalar\CustomScalarInterface
Something like:
For example, a query that accepts JSON as input and returns JSON as output and has a resolver that returns you an argument that you just passed then you will see a picture similar to this:
This feature could be widely useful to express values that may have validation, like HTML, emails, URLs, dates, etc., and for more advanced cases like EAV attributes, where value can be expressed as a single scalar or array of scalars.
Contribution checklist (*)
Resolved issues: