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

Root types #129

Merged
merged 8 commits into from
Feb 8, 2024
Merged

Root types #129

merged 8 commits into from
Feb 8, 2024

Conversation

LastDragon-ru
Copy link
Owner

@LastDragon-ru LastDragon-ru commented Feb 8, 2024

Added root types for @searchBy and @sortBy which will contain extra operators only, so the query a bit changed:

query {
    # WHERE name = "LastDragon"
    users(
        where: {
            field: { name: { equal: "LastDragon" } }
        }
    ) {
        id
    }

    
    comments(
        # Relationship: WHERE EXIST (related table)
        where: {
            field: {
                user: {
                    where: {
                        field: {
                            date: { between: { min: "2021-01-01", max: "2021-04-01" } }
                        }
                    }
                }
            }
        }

        # ORDER BY user.name ASC, text DESC
        order: [
            { field: { user: { name: asc } } }
            { field: { text: desc } }
        ]
    )
}

The main advantage of this change - no more conflicts between extra operators and object fields. If you want to restore old structure please see Upgrade Guide.

Closes: #118

@LastDragon-ru LastDragon-ru added scope: feat New feature or request pkg: graphql ! Breaking change labels Feb 8, 2024
@LastDragon-ru LastDragon-ru added this to the Next milestone Feb 8, 2024
@LastDragon-ru LastDragon-ru self-assigned this Feb 8, 2024
@LastDragon-ru LastDragon-ru merged commit 693df03 into main Feb 8, 2024
116 checks passed
@LastDragon-ru LastDragon-ru deleted the graphql/RootTypes branch February 8, 2024 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
! Breaking change pkg: graphql scope: feat New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Extra operators should be available on top level only (@sortBy)
1 participant