Skip to content

Commit 555edfe

Browse files
committed
fix: update nuxt ssr example to replace internal types
1 parent bcc6b64 commit 555edfe

File tree

2 files changed

+26
-40
lines changed
  • src/pages
    • [platform]/build-a-backend/data/connect-from-server-runtime/nuxtjs-server-runtime
    • gen1/[platform]/build-a-backend/server-side-rendering/nuxt

2 files changed

+26
-40
lines changed

src/pages/[platform]/build-a-backend/data/connect-from-server-runtime/nuxtjs-server-runtime/index.mdx

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,6 @@ import type {
134134
LibraryOptions,
135135
FetchAuthSessionOptions,
136136
} from "@aws-amplify/core";
137-
import type {
138-
GraphQLOptionsV6,
139-
GraphQLResponseV6,
140-
} from "@aws-amplify/api-graphql";
141137

142138
import outputs from "../amplify_outputs.json";
143139

@@ -309,22 +305,19 @@ export default defineNuxtPlugin({
309305
client: {
310306
// Follow this typing to ensure the`graphql` API return type can
311307
// be inferred correctly according to your queries and mutations
312-
graphql: <
313-
FALLBACK_TYPES = unknown,
314-
TYPED_GQL_STRING extends string = string
315-
>(
316-
options: GraphQLOptionsV6<FALLBACK_TYPES, TYPED_GQL_STRING>,
317-
additionalHeaders?: Record<string, string>
308+
graphql:(
309+
options: Parameters<typeof gqlServerClient.graphql>[1],
310+
additionalHeaders?: Record<string, string>
318311
) =>
319-
runWithAmplifyServerContext<
320-
GraphQLResponseV6<FALLBACK_TYPES, TYPED_GQL_STRING>
321-
>(amplifyConfig, libraryOptions, (contextSpec) =>
322-
gqlServerClient.graphql(
323-
contextSpec,
324-
options,
325-
additionalHeaders
326-
)
327-
),
312+
runWithAmplifyServerContext<
313+
ReturnType<typeof gqlServerClient.graphql>
314+
>(amplifyConfig, libraryOptions, (contextSpec) =>
315+
gqlServerClient.graphql(
316+
contextSpec,
317+
options,
318+
additionalHeaders
319+
)
320+
),
328321
},
329322
},
330323
},

src/pages/gen1/[platform]/build-a-backend/server-side-rendering/nuxt/index.mdx

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,6 @@ import type {
145145
LibraryOptions,
146146
FetchAuthSessionOptions
147147
} from '@aws-amplify/core';
148-
import type {
149-
GraphQLOptionsV6,
150-
GraphQLResponseV6
151-
} from '@aws-amplify/api-graphql';
152148

153149
import config from '../amplifyconfiguration.json';
154150

@@ -328,24 +324,21 @@ export default defineNuxtPlugin({
328324
client: {
329325
// Follow this typing to ensure the`graphql` API return type can
330326
// be inferred correctly according to your queries and mutations
331-
graphql: <
332-
FALLBACK_TYPES = unknown,
333-
TYPED_GQL_STRING extends string = string
334-
>(
335-
options: GraphQLOptionsV6<FALLBACK_TYPES, TYPED_GQL_STRING>,
336-
additionalHeaders?: Record<string, string>
327+
graphql:(
328+
options: Parameters<typeof gqlServerClient.graphql>[1],
329+
additionalHeaders?: Record<string, string>
337330
) =>
338-
runWithAmplifyServerContext<
339-
GraphQLResponseV6<FALLBACK_TYPES, TYPED_GQL_STRING>
340-
>(amplifyConfig, libraryOptions, (contextSpec) =>
341-
gqlServerClient.graphql(
342-
contextSpec,
343-
options,
344-
additionalHeaders
345-
)
346-
)
347-
}
348-
}
331+
runWithAmplifyServerContext<
332+
ReturnType<typeof gqlServerClient.graphql>
333+
>(amplifyConfig, libraryOptions, (contextSpec) =>
334+
gqlServerClient.graphql(
335+
contextSpec,
336+
options,
337+
additionalHeaders
338+
)
339+
),
340+
},
341+
},
349342
}
350343
}
351344
};

0 commit comments

Comments
 (0)