Skip to content

Commit

Permalink
wip: basic functions (#1)
Browse files Browse the repository at this point in the history
* wip

* chore: upgrade next and react

* schema: update github schema

* schema: auto generate ghall schema

* schema: update ghall schema

* schema: fix missing types

* chore: regen schema

* chore: upgrade apollo and graphql

* chore: regen schema

* wip

* chore: rename to ghall

* chore: update README

* chore: upgrade typescript

* chore: update next

* wip

* wip

* wip
  • Loading branch information
EqualMa authored Feb 20, 2021
1 parent 0ab740f commit 812291a
Show file tree
Hide file tree
Showing 37 changed files with 12,407 additions and 9,917 deletions.
43 changes: 11 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,23 @@
Access GitHub public data through REST or GraphQL api **without authorization**

## REST Api

## GraphQL Api

the design principle of `ghack` GraphQL api is:

`ghack` GraphQL api should be a subset of [GitHub GraphQL Api](https://docs.github.com/graphql), which means:

- [`ghack` graphql schema](schema.ghack.graphql) should be a subset of [GitHub public graphql schema](https://docs.github.com/public/schema.docs.graphql),
`WIP` Still working in progress

- each query to `ghack` graphql api, should be also a valid query for GitHub GraphQL Api, and have same response

For short: **`ghack` GraphQL api is an implementation for a subset of GitHub GraphQL Api**

## Getting Started

First, run the development server:

```bash
npm run dev
# or
yarn dev
```
## REST Api

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
> Documentation for REST Api is not completed yet
You can start editing the page by modifying `pages/index.js`. The page auto-updates as you edit the file.
## GraphQL Api

## Learn More
- `Api Endpoint` https://ghall.now.sh/api

To learn more about Next.js, take a look at the following resources:
- `Api Explorer` https://ghall.now.sh/graphiql

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
the design principle of `ghall` GraphQL api is:

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
`ghall` GraphQL api should be a subset of [GitHub GraphQL Api](https://docs.github.com/graphql), which means:

## Deploy on Vercel
- [`ghall` graphql schema](schema.ghall.graphql) should be a subset of [GitHub public graphql schema](https://docs.github.com/public/schema.docs.graphql),

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/import?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
- each query to `ghall` graphql api, should be also a valid query for GitHub GraphQL Api, and have same response

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
In short: **`ghall` GraphQL api is an implementation for a subset of GitHub GraphQL Api**
20 changes: 18 additions & 2 deletions codegen.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
overwrite: true
schema: "schema.ghack.graphql"
schema: "schema.ghall.graphql"
documents: "src/graphql/**/*.graphql"
generates:
src/graphql/generated.ts:
config:
# https://graphql-code-generator.com/docs/plugins/typescript-resolvers#integration-with-apollo-server
useIndexSignature: true
avoidOptionals: true
noSchemaStitching: true
scalars:
HTML: string
URI: string
mappers:
User: ../github/crawler#UserExtractor
User: import("./auto-resolvers").UserInstanceResolver
PinnableItemConnection: import("./auto-resolvers").PinnableItemConnectionInstanceResolver
RepositoryOwner: import("./auto-resolvers").RepositoryOwnerInstanceResolver
plugins:
- "typescript"
- "typescript-operations"
Expand All @@ -16,6 +23,15 @@ generates:
./graphql.schema.json:
plugins:
- "introspection"
src/graphql/auto-resolvers.ts:
config:
generateTypesFor:
- User
- PinnableItemConnection
- RepositoryOwner
generatedResolversPath: ./generated
plugins:
- scripts/auto-resolver-plugin.js
hooks:
afterAllFileWrite:
- prettier --write
Loading

1 comment on commit 812291a

@vercel
Copy link

@vercel vercel bot commented on 812291a Feb 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.