-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #201 from sejori/graphql
Graphql Schema PoC
- Loading branch information
Showing
20 changed files
with
1,288 additions
and
56 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
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,11 @@ | ||
{ | ||
"name": "@sejori/peko", | ||
"description": "Featherweight apps on the edge, built with Web Standards 🐣⚡", | ||
"version": "2.2.0", | ||
"exports": "./mod.ts", | ||
"imports": { | ||
"esbuild": "https://deno.land/x/[email protected]/mod.js", | ||
"htm": "https://ga.jspm.io/npm:[email protected]/dist/htm.mjs", | ||
"preact": "https://npm.reversehttp.com/preact,preact/hooks,htm/preact,preact-render-to-string" | ||
} | ||
} |
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
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
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
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,4 +1,4 @@ | ||
import { html } from "htm/preact"; | ||
import { html } from "preact"; | ||
|
||
import Layout from "../components/Layout.ts"; | ||
|
||
|
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,26 @@ | ||
import { RequestContext } from "../Router.ts"; | ||
import { mergeHeaders } from "../utils/helpers.ts"; | ||
import { Schema } from "../utils/Schema.ts"; | ||
import { Handler, HandlerOptions } from "../types.ts"; | ||
|
||
export interface graphQLHandlerOptions extends HandlerOptions { | ||
loaders: Record<string, (input: any) => Promise<any>>; | ||
} | ||
|
||
export const graphQL = ( | ||
schema: Schema, | ||
opts: graphQLHandlerOptions | ||
): Handler => { | ||
return async function GraphQLHandler(ctx: RequestContext) { | ||
// THIS IS WIP | ||
|
||
return new Response("WIP", { | ||
headers: mergeHeaders( | ||
new Headers({ | ||
"Content-Type": "application/json", | ||
}), | ||
opts.headers | ||
), | ||
}); | ||
}; | ||
}; |
Oops, something went wrong.