added initial configuration for GraphQL #102
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
GraphQL is a new paradigm to replace REST APIs which makes for a more flexible way to make requests. To learn more about them go to this link.
This PR hopes to take the initial steps to be able to, in future projects, use a GraphQL API. Right now it only "replicates" the functionality to get users by id or to get all users. Of course with the caveat that one can get subsets of the user data. For example, going to https://localhost:5001/ui/playground (if you are running your project in the local port 5001) you can write the following query:
This will return a list of all usernames in the application. Right now getting emails will fail because the GraphQL API seems to default to them being non-nullable. Haven't found out how to change this yet.
The tutorial that was used to set this up was: https://medium.com/swlh/the-no-bullsh-t-guide-to-graphql-in-net-core-9df290be7f27
Some corrections had to be made from this tutorial as well: https://medium.com/volosoft/building-graphql-apis-with-asp-net-core-419b32a5305b