Skip to content
This repository was archived by the owner on Dec 20, 2024. It is now read-only.

feat: add endpoints for graphql api#108

Open
burhaaan wants to merge 1 commit intocontra:mainfrom
burhaaan:burhan/backend-assessment
Open

feat: add endpoints for graphql api#108
burhaaan wants to merge 1 commit intocontra:mainfrom
burhaaan:burhan/backend-assessment

Conversation

@burhaaan
Copy link

@burhaaan burhaaan commented May 5, 2023

Check out my loom here: https://www.loom.com/share/5a05f62b1e08487897e4039ff774ee58

Description

This PR introduces changes to the GraphQL API to support the feature flag service and adds two mutations and one query. The schema, mutations, queries, and resolvers have been updated to manage feature flags for users, fetch all users with their associated feature flags, and update feature flag assignments for a specific user. These changes enable better feature flag management in the application, allowing clients to easily assign, retrieve, and update feature flag values for users.

Changes

  • Added a new query allUsersWithFeatureFlags to fetch all users and their associated feature flags.

  • Implemented a new mutation assignFeatureFlagToUsers to target one or more users with a specific feature flag.

  • Implemented a new mutation updateFeatureFlagAssignment to change the value of a feature flag for a specific user.

  • Updated resolvers to process SQL query results, create the hierarchical data structure, and handle new mutations and queries.

Areas for Improvement

  • Add error handling and validation: Enhance the GraphQL resolvers to handle potential errors and validate input data.

  • Implement pagination: Introduce pagination support for the allUsersWithFeatureFlags query to handle large datasets efficiently and improve API response times.

Concluding Thoughts

The changes introduced in this PR provide a solid foundation for managing user-feature flag relationships in the GraphQL API. By implementing these updates, clients can easily assign, retrieve, and update feature flag values for users, improving the overall feature flag management experience. Future enhancements should focus on optimizing performance, adding error handling and validation.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant