aboutsummaryrefslogtreecommitdiffstats
path: root/src/services/graphql/api.ts
Commit message (Collapse)AuthorAgeFilesLines
* refactor(services, types): reorganize GraphQL fetchers and data typesArmand Philippot2023-11-271-83/+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(hooks): remove useSettings hookArmand Philippot2023-11-151-10/+9
| | | | | | | It does not make sense to re-export an existing object through a hook. On some pages both the hook and the object was imported... It is better to use the CONFIG (previously settings) object directly and by doing it we avoid potential errors because of conditional hooks.
* refactor: use named export for everything except pagesArmand Philippot2023-09-201-3/+1
| | | | | | 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-3/+3
| | | | | | 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.
* refactor(types): move and rename GraphQL typesArmand Philippot2022-08-201-269/+43
| | | | | | | 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: handle blog pagination when JS is disabledArmand Philippot2022-05-201-0/+9
|
* chore: add Article pagesArmand Philippot2022-05-151-1/+51
|
* chore: add Search pageArmand Philippot2022-05-151-4/+11
|
* chore: add blog page widgetsArmand Philippot2022-05-131-1/+9
|
* chore: add a Contact pageArmand Philippot2022-05-071-5/+21
|
* refactor: rewrite API fetching method and GraphQL queriesArmand Philippot2022-05-021-0/+222
|
* chore: remove old pages, components, helpers and typesArmand Philippot2022-04-291-25/+0
| | | | | Since I'm using new components, I will also rewrite the GraphQL queries so it is easier to start from scratch.
* chore: use a different configuration depending on app envArmand Philippot2022-03-041-1/+2
| | | | | | It will be useful with Docker. Instead of cloning the project with a different configuration, I can manage two different configuration thanks to dotenv and some checking inside the app.
* refactor: avoid useless assignement before return statementArmand Philippot2022-01-041-5/+2
|
* refactor: rewrite types and servicesArmand Philippot2021-12-201-0/+27
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.