Skip to content

Conversation

kidunot89
Copy link
Collaborator

Your checklist for this pull request

Thanks for sending a pull request! Please make sure you click the link above to view the
contribution guidelines, then fill out the blanks below.

🚨Please review the guidelines for contributing to this repository.

  • Make sure you are making a pull request against the develop branch (left side).
    Also you should start your branch off our develop.
  • Make sure you are requesting to pull request from a topic/feature/bugfix/devops
    branch
    (right side). Don't pull request from your master!
  • Have you ensured/updated that CLI tests to extend coverage to any new logic. Learn how
    to modify the tests here.

What does this implement/fix? Explain your changes.

This PR implements multiple enhancements and bug fixes:

1. ProductTaxonomyInput Direct OR/AND Syntax (Fixes #400)

  • Added direct or and and fields to ProductTaxonomyInput GraphQL type
  • Updated Product_Connection_Resolver to handle both new and legacy syntaxes with proper
    priority
  • Maintains full backward compatibility with existing relation + filters syntax

2. OrderNotes Query Fix (Fixes #553)

  • Fixed issue where orderNotes queries were returning empty arrays
  • Added permission filters in Core_Schema_Filters to make order notes visible for
    authorized users
  • Added visibility filter to ensure order note fields are accessible to order owners
  • Updated Order_Note_Type field resolvers to properly handle Comment model properties
  • Shop managers/admins can see all order notes, customers can see customer notes on their
    own orders

3. Complete OrderNote Implementation

  • Added Order_Note_Type GraphQL object type with full field definitions
  • Implemented Order_Note_Create mutation for creating order notes
  • Implemented Order_Note_Delete mutation for deleting order notes
  • Fixed permission issues in OrderNote mutations to ensure fields are visible to authorized
    users
  • Registered OrderNote types and mutations in schema
  • Updated Order model with OrderNote support
  • Enhanced comments connection handling for order notes

4. Test Improvements & Fixes

  • Added comprehensive test coverage for new taxonomy filter functionality
  • Added test for orderNotes query functionality
  • Added tests for createOrderNote and deleteOrderNote mutations
  • Fixed Stripe test configuration bug (test_secret_key using wrong API key)
  • Fixed Behat Gherkin dependency compatibility issue
  • Enhanced CartMutationsTest and OrderMutationsTest coverage

5. Infrastructure & Dependencies

  • Updated .gitignore with additional patterns
  • Fixed dependency compatibility in bin/_lib.sh
  • Updated composer dependencies

New Usage Examples:

ProductTaxonomyInput (New Syntax):

# OR logic
products(where: { taxonomyFilter: { or: [
  { taxonomy: PRODUCTCATEGORY, terms: ["electronics"] },
  { taxonomy: PRODUCTTAG, terms: ["sale"] }
] } })

# AND logic
products(where: { taxonomyFilter: { and: [
  { taxonomy: PRODUCTCATEGORY, terms: ["electronics"] },
  { taxonomy: PRODUCTTAG, terms: ["premium"] }
] } })

OrderNotes Query:
query {
  order(id: "order_id") {
    orderNotes {
      nodes {
        id
        databaseId
        note
        dateCreated
        isCustomerNote
      }
    }
  }
}

OrderNote Mutations:
# Create order note
mutation {
  createOrderNote(input: {
    orderId: "order_id"
    note: "Order note content"
    isCustomerNote: false
  }) {
    orderNote {
      id
      note
      dateCreated
      isCustomerNote
    }
  }
}

# Delete order note
mutation {
  deleteOrderNote(input: {
    id: "order_note_id"
  }) {
    orderNote {
      id
      note
    }
    order {
      id
    }
  }
}

Does this close any currently open issues?

Closes #400
Closes #553

Any relevant logs, error output, GraphiQL screenshots, etc?

All tests pass successfully:

  • ProductsQueriesTest: 7/7 tests passing (including new taxonomy filter tests)
  • OrderQueriesTest: Now includes passing orderNotes query test
  • OrderMutationsTest: Both createOrderNote and deleteOrderNote mutation tests passing
  • CheckoutMutationTest: All tests passing after Stripe API key fix
  • Full test suite runs without dependency blocking errors

Any other comments?

This comprehensive update enhances the plugin's taxonomy filtering capabilities while fixing the long-standing orderNotes query issue (#553). The ProductTaxonomyInput changes provide the cleaner syntax requested by users while ensuring no breaking changes. The OrderNote implementation adds full CRUD operations for order notes via GraphQL mutations with proper permission handling, ensuring order notes are properly accessible through both queries and mutations. The visibility filters ensure that order owners can access their order notes while maintaining security.

@kidunot89 kidunot89 added enhancement New feature or request bugfix Implements bugfix labels Aug 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Implements bugfix enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

orderNotes returns null Multiple Taxonomy Query
1 participant