-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7d82d0b
commit e1a7b12
Showing
16 changed files
with
7,278 additions
and
7,342 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
example |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = { | ||
reactStrictMode: true, | ||
} | ||
reactStrictMode: true, | ||
}; | ||
|
||
module.exports = nextConfig | ||
module.exports = nextConfig; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import { loadSchemaSync } from "@graphql-tools/load"; | ||
import { GraphQLFileLoader } from "@graphql-tools/graphql-file-loader"; | ||
|
||
// const mySchema = await loadSchema("../schema/schema.graphql", { | ||
// loaders: [new GraphQLFileLoader()], | ||
// }); | ||
|
||
import { schemaParser } from "../../../lib/index.js"; | ||
|
||
const loadedSchema = loadSchemaSync("../../../schema/schema.graphql", { | ||
loaders: [new GraphQLFileLoader()], | ||
}); | ||
|
||
const t = new schemaParser(loadedSchema); | ||
|
||
console.log(loadedSchema); | ||
|
||
export default function Post({ postData }) { | ||
return ( | ||
<div className="h-screen p-16 text-gray-100 bg-gray-800"> | ||
<div className="text-3xl font-bold text-center">{postData.title}</div> | ||
<div className="my-8 text-justify text-gray-200"> | ||
{postData.description} | ||
</div> | ||
<div className="text-gray-400">Published On: {postData.date}</div> | ||
</div> | ||
); | ||
} | ||
|
||
export async function getStaticProps(context) { | ||
const { type } = context.params; | ||
console.log(type); | ||
return { | ||
props: { | ||
postData: { | ||
description: "ciao come va?", | ||
title: "CIAO", | ||
date: "2020-02-02", | ||
}, | ||
}, | ||
}; | ||
} | ||
|
||
export async function getStaticPaths() { | ||
const routes = t.getRoutes(); | ||
console.log(routes); | ||
return routes; | ||
// const paths = [ | ||
// ["object", "author"], | ||
// ["scalar", "id"], | ||
// ["scalar", "string"], | ||
// ["object", "post"], | ||
// ["scalar", "int"], | ||
// ["object", "query"], | ||
// ["object", "mutation"], | ||
// ["scalar", "boolean"], | ||
// ]; | ||
// return { | ||
// paths: [ | ||
// { params: { type: ["object", "author"] } }, | ||
// { params: { type: ["object", "mutation"] } }, | ||
// ], | ||
// fallback: true, | ||
// }; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export default function SchemaIndex() { | ||
return ( | ||
<main className="flex flex-col items-center justify-between min-h-screen p-24"> | ||
this is the index! | ||
</main> | ||
); | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.