It's really great to have a single endpoint and expose all the data. I find below points to be considered for GraphQL:
- Implementation of File Download / Upload gets tricky (converting to string might not be a best option for large files)
- A lot of boilerplate and schema code at both frontend and backend.
- Follow and support pagination provided in the GraphQL specification.
- Allow custom order and prioritizing logic for ordering of fields. Example if we fetch users data and associated groups and roles. A user can multi sort the data based on username, group name or role name.
- Authentication and Authorization would be dependent on the backend framework.
- Ensure the backend optimization and Database support to fire single query for each graphql command might get tricky.
Also, one should consider the Pros after its implementation :
- Very flexible to support new items and update existing behaviour.
Easy to add conditions using arguments and custom ordering once implemented
Use a lot of custom filters and get rid of all the actions that needs to be created example a user can have id, name, etc as arguments and perform the filtering. Additionally the filters can be applied on the groups in the users as well.
- Ease of testing API by creating files containing all the GraphQL queries and mutations.
- Mutations are straightforward and easy to implement once understood the concept.
- Powerful way to fetch multiple depths of data.
- Support of Voyager and GraphiQL UI or Playground makes it easy to view and use.
- Ease of documentation while defining the schema with valid description methods.