Update TypeScript configuration for stricter type checks and modify environment variable access. Exclude additional directories from compilation, enhance error handling in resolvers, and improve random element selection in mock data generation. Refactor locale handling in middleware and update GraphQL client to use bracket notation for environment variables.
This commit is contained in:
@@ -50,7 +50,7 @@ export const resolvers = {
|
||||
products: async (
|
||||
_: unknown,
|
||||
args: { limit?: number },
|
||||
context: GraphQLContext
|
||||
_context: GraphQLContext
|
||||
) => {
|
||||
return withErrorHandling(() => dataService.getProducts(args.limit));
|
||||
},
|
||||
@@ -71,7 +71,7 @@ export const resolvers = {
|
||||
pageSeo: async (
|
||||
_: unknown,
|
||||
args: { locale?: string },
|
||||
context: GraphQLContext
|
||||
_context: GraphQLContext
|
||||
) => {
|
||||
return withErrorHandling(() => dataService.getPageSeo(args.locale));
|
||||
},
|
||||
@@ -96,14 +96,14 @@ export const resolvers = {
|
||||
pages: async (
|
||||
_: unknown,
|
||||
args: { locale?: string },
|
||||
context: GraphQLContext
|
||||
_context: GraphQLContext
|
||||
) => {
|
||||
return withErrorHandling(() => dataService.getPages(args.locale));
|
||||
},
|
||||
homepage: async (
|
||||
_: unknown,
|
||||
args: { locale?: string },
|
||||
context: GraphQLContext
|
||||
_context: GraphQLContext
|
||||
) => {
|
||||
return withErrorHandling(async () => {
|
||||
// Homepage ist immer die Seite mit dem Slug "/"
|
||||
@@ -117,7 +117,7 @@ export const resolvers = {
|
||||
navigation: async (
|
||||
_: unknown,
|
||||
args: { locale?: string },
|
||||
context: GraphQLContext
|
||||
_context: GraphQLContext
|
||||
) => {
|
||||
return withErrorHandling(() => dataService.getNavigation(args.locale));
|
||||
},
|
||||
@@ -133,7 +133,7 @@ export const resolvers = {
|
||||
translations: async (
|
||||
_: unknown,
|
||||
args: { locale?: string; namespace?: string },
|
||||
context: GraphQLContext
|
||||
_context: GraphQLContext
|
||||
) => {
|
||||
return withErrorHandling(() =>
|
||||
dataService.getTranslations(args.locale, args.namespace)
|
||||
@@ -144,7 +144,7 @@ export const resolvers = {
|
||||
register: async (
|
||||
_: unknown,
|
||||
args: { email: string; password: string; name: string },
|
||||
context: GraphQLContext
|
||||
_context: GraphQLContext
|
||||
) => {
|
||||
return withErrorHandling(async () => {
|
||||
const result = await userService.register({
|
||||
@@ -167,7 +167,7 @@ export const resolvers = {
|
||||
login: async (
|
||||
_: unknown,
|
||||
args: { email: string; password: string },
|
||||
context: GraphQLContext
|
||||
_context: GraphQLContext
|
||||
) => {
|
||||
return withErrorHandling(async () => {
|
||||
const result = await userService.login({
|
||||
|
||||
Reference in New Issue
Block a user