diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 0000000000..5139ea6a2e --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,18 @@ +name: CI +on: pull_request + +jobs: + tests: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-node@v1 + + - run: yarn install + + # Verify it compiles + - run: yarn build + + # Doesn't pass ATM + # - run: yarn tsc --noEmit diff --git a/notes/ContributingToCodePage.md b/notes/ContributingToCodePage.md new file mode 100644 index 0000000000..2ac02d4479 --- /dev/null +++ b/notes/ContributingToCodePage.md @@ -0,0 +1,78 @@ +## Contributing to the Code Page + +Hi, thanks for reading the docs! + +Secondly, we want to provide a really strong overview of all the libraries in the GraphQL eco-system. To make this +easy for contributors the code page is automatically generated from a series of markdown files in this repo. + +```sh +$ tree src/content/code +src/content/code +├── language-support +│ ├── c-c +│ │ └── tools +│ │ └── libgraphqlparser.md +│ ├── clojure +│ │ ├── client +│ │ │ └── regraph.md +│ │ └── server +│ │ ├── alumbra.md +│ │ ├── graphql-clj.md +│ │ └── lacinia.md +│ ├── c-net +│ │ ├── client +│ │ │ ├── graphql-client.md +│ │ │ ├── graphql-net-client.md +│ │ │ └── sahb-graphqlclient.md +// etc +``` + +We'd love any new project to include a few paragraphs describing its goals and usage, the goal here is to make it easy for people to decide between options. + +Here's an optimal example example of what we're looking for: + +- It uses yml frontmatter to provide additional information like repo, npm +- It explains itself in the 'description' then fills fleshes out that description with some code samples + +````md +--- +name: Express GraphQL +description: The reference implementation of a GraphQL API server over an Express webserver. You can use this to run GraphQL in conjunction with a regular Express webserver, or as a standalone GraphQL server. +url: /graphql-js/running-an-express-graphql-server/ +github: graphql/express-graphql +npm: "express-graphql" +--- + +To run an `express-graphql` hello world server: + +```bash +npm install express express-graphql graphql +``` + +Then run `node server.js` with this code in `server.js`: + +```js +var express = require('express'); +var { graphqlHTTP } = require('express-graphql'); +var { buildSchema } = require('graphql'); + +var schema = buildSchema(` + type Query { + hello: String + } +`); + +var root = { hello: () => 'Hello world!' }; + +var app = express(); +app.use('/graphql', graphqlHTTP({ + schema: schema, + rootValue: root, + graphiql: true, +})); +app.listen(4000, () => console.log('Now browse to localhost:4000/graphql')); +``` + +```` + +Any library/tool/service has a maximum height in the site, and then it can be expanded by clicking, so if you need quite a lot of space to explain your project then that's OK. diff --git a/src/pages/code.tsx b/src/pages/code.tsx index 0e3ae0a916..1b9e0ca9c0 100644 --- a/src/pages/code.tsx +++ b/src/pages/code.tsx @@ -251,6 +251,7 @@ export default ({ pageContext }: any) => { {buildLibraryList(pageContext.otherLibraries.Services, pageContext)} +
Want to improve this page? See the docs here.
)