aboutsummaryrefslogtreecommitdiffstats
path: root/src/services/graphql/comments.ts
Commit message (Collapse)AuthorAgeFilesLines
* refactor(services, types): reorganize GraphQL fetchers and data typesArmand Philippot2023-11-271-177/+0
| | | | | | | | | | | | The Typescript mapped types was useful for autocompletion in fetchers but their are harder to maintain. I think it's better to keep each query close to its fetcher to have a better understanding of the fetched data. So I: * colocate queries with their own fetcher * colocate mutations with their own mutator * remove Typescript mapped types for queries and mutations * move data convertors inside graphql services * rename most of data types and fetchers
* refactor: use named export for everything except pagesArmand Philippot2023-09-201-6/+10
| | | | | | Next expect a default export for pages so only those components should use default exports. Everything else should use named exports to reduce the number of import statements.
* refactor(build): replace paths aliases with relative pathsArmand Philippot2023-09-191-6/+6
| | | | | | Using paths aliases starting with "@" can be confusing and can lead to conflict with existings modules. I prefer to use relative paths to avoid extra configuration in tools because of these aliases.
* fix(comments): load all comments on a postArmand Philippot2022-08-211-40/+104
| | | | | | | | | Previously, only the first 10 comments was loaded. So I update the fetching method to retrieve all the comments on a post. Also, I choose to order comments on client side because of a bug with WPGraphQL. Finally, I renamed the Comment type to SingleComment to avoid conflict with existing types.
* refactor(types): move and rename GraphQL typesArmand Philippot2022-08-201-20/+27
| | | | | | | The api file in services was not really readable. So I move the types and I also rewrite a little the fetch function. I also rename most of the type to avoid conflict with preexisting types (like Node) and to keep consistency.
* chore: add Article pagesArmand Philippot2022-05-151-0/+102
|
* refactor: rewrite types and servicesArmand Philippot2021-12-201-68/+0
| | | | | | | I was repeating myself a lot in services. So I rewrited the different functions to improve readability and I extracted some formatting functions to put them in utils. I also rewrited/reorganized some types to keep consistent names.
* chore: create mutation to add a new comment on postsArmand Philippot2021-12-171-0/+68