Skip to content

Commit 51de63e

Browse files
committed
fix: cleanup graphql typings and comments
1 parent 8019121 commit 51de63e

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

examples/astro/previews/example-app/src/pages/wp-templates/home.astro

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
---
22
import Layout from "../../layouts/Layout.astro";
33
import { authHeaders, client, gql } from "../../lib/client";
4+
45
/**
56
* This is a template for the WordPress template hierarchy.
67
* It will be used to render the WordPress templates.
78
* It should never be used directly.
89
* This check confirms that the template is being used in the correct context.
910
* If the template is being used directly, it will redirect to the 404 page.
10-
*
11-
* Once https://github.com/withastro/astro/issues/13555 is fixed, this check can be changed to:
12-
* if (Astro.url.pathname === Astro.originPathname)
13-
*
1411
*/
1512
if (Astro.url.pathname === Astro.originPathname) {
1613
return Astro.rewrite("/404");

examples/astro/previews/example-app/src/pages/wp-templates/index.astro

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@
55
* It should never be used directly.
66
* This check confirms that the template is being used in the correct context.
77
* If the template is being used directly, it will redirect to the 404 page.
8-
*
9-
* Once https://github.com/withastro/astro/issues/13555 is fixed, this check can be changed to:
10-
* if (Astro.url.pathname === Astro.originPathname)
11-
*
128
*/
139
if (Astro.url.pathname === Astro.originPathname) {
1410
return Astro.rewrite("/404");
@@ -21,7 +17,7 @@ const databaseId = Astro.locals.templateData?.databaseId;
2117
const isPreview = Astro.locals.isPreview;
2218
2319
const query = gql`
24-
query indexTemplateNodeQuery($id: ID!, $isPreview: Boolean!) {
20+
query indexTemplateNodeQuery($id: ID!, $isPreview: Boolean = false) {
2521
node: contentNode(id: $id, idType: DATABASE_ID, asPreview: $isPreview) {
2622
__typename
2723
uri

examples/astro/previews/example-app/src/pages/wp-templates/single.astro

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ const databaseId = Astro.locals.templateData?.databaseId;
1717
1818
const { data, error } = await client.query(
1919
gql`
20-
query singleTemplatePageQuery($databaseId: ID!, $isPreview: Boolean!) {
20+
query singleTemplatePageQuery(
21+
$databaseId: ID!
22+
$isPreview: Boolean = false
23+
) {
2124
post: contentNode(
2225
id: $databaseId
2326
idType: DATABASE_ID

0 commit comments

Comments
 (0)