Skip to content

GraphQL documentation contains fields that are not defined in the schema #39821

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

Closed
DuckThom opened this issue Apr 16, 2025 · 6 comments
Closed
Assignees
Labels
Issue: needs update Additional information is require, waiting for response Reported on 2.4.8 Indicates original Magento version for the Issue report. Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it

Comments

@DuckThom
Copy link

The GraphQL documentation for the Discount type lists fields that are not present in neither 2.4.7 nor 2.4.8 (open source and enterprise).

https://developer.adobe.com/commerce/webapi/graphql-api/#definition-Discount

Image

The only fields that are in the schema are these:

magento/module-quote-graph-ql/etc/schema.graphqls

type Discount @doc(description:"Defines an individual discount. A discount can be applied to the cart as a whole or to an item, shipping.") {
    amount: Money! @doc(description:"The amount of the discount.")
    applied_to: CartDiscountType! @doc(description:"The type of the entity the discount is applied to.")
    label: String! @doc(description:"A description of the discount.")
}

And this one:

magento/module-sales-rule-graph-ql/etc/schema.graphqls

type Discount {
    coupon: AppliedCoupon @resolver(class: "Magento\\SalesRuleGraphQl\\Model\\Resolver\\Coupon") @doc(description:"The coupon related to the discount.")
}

The fields is_discounting_locked, type and value are not defined anywhere in the schema files.

Image

Copy link

m2-assistant bot commented Apr 16, 2025

Hi @DuckThom. Thank you for your report.
To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce.


Join Magento Community Engineering Slack and ask your questions in #github channel.
⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
🕙 You can find the schedule on the Magento Community Calendar page.
📞 The triage of issues 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.

Copy link

m2-assistant bot commented Apr 21, 2025

Hi @engcom-November. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
  • 3. Add Area: XXXXX label to the ticket, indicating the functional areas it may be related to.
  • 4. Verify that the issue is reproducible on 2.4-develop branch
    Details- If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
  • 5. Add label Issue: Confirmed once verification is complete.
  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@engcom-November engcom-November added the Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it label Apr 21, 2025
@engcom-November engcom-November removed their assignment Apr 21, 2025
@engcom-Hotel engcom-Hotel self-assigned this Apr 24, 2025
Copy link

m2-assistant bot commented Apr 24, 2025

Hi @engcom-Hotel. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
  • 3. Add Area: XXXXX label to the ticket, indicating the functional areas it may be related to.
  • 4. Verify that the issue is reproducible on 2.4-develop branch
    Details- If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
  • 5. Add label Issue: Confirmed once verification is complete.
  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@engcom-Hotel
Copy link
Contributor

Hello @DuckThom,

Thanks for the report and collaboration!

All the above mentioned fields type, value, is_discounting_locked are part of the Magento2B2B, from the NegotiableQuoteGraphQl module.

Please let us know if you still having any issues.

Thanks

@engcom-Hotel engcom-Hotel added the Issue: needs update Additional information is require, waiting for response label Apr 24, 2025
@ct-prd-projects-boards-automation ct-prd-projects-boards-automation bot moved this from Ready for Confirmation to Needs Update in Issue Confirmation and Triage Board Apr 24, 2025
@DuckThom
Copy link
Author

@engcom-Hotel Aah, that explains a lot. Perhaps some kind of indication in the docs would be helpful then. To show maybe which module the field belongs to, or, if it's provided by a "non standard" module. For example, these fields would show as:

Field             | Description 
label - String    | A description of the discount.
value - Float     | (b2b extension) Quote line item discount value. 
type - String     | (b2b extension) ... 

Either way, I'll have to look for a different way to show in the frontend if a discount is a fixed amount or a percentage.

@engcom-Hotel
Copy link
Contributor

Hello @DuckThom,

Its a good suggestion, but on this board we are accepting issues related to Magento 2 core. For document related issues, I suggest you to create an issue on this repo https://github.com/AdobeDocs/commerce-webapi

We are closing this issue.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: needs update Additional information is require, waiting for response Reported on 2.4.8 Indicates original Magento version for the Issue report. Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it
Projects
None yet
Development

No branches or pull requests

4 participants