-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into issue-2542-clean-schema-update-table
Resolve Conflicts: server/src-exec/Migrate.hs
- Loading branch information
Showing
120 changed files
with
14,118 additions
and
1,225 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
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
7 changes: 2 additions & 5 deletions
7
community/boilerplates/remote-schemas/google-cloud-functions/nodejs/localDev.js
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,11 +1,8 @@ | ||
const { ApolloServer } = require('apollo-server'); | ||
const express = require('express'); | ||
const app = express(); | ||
|
||
const { typeDefs, resolvers } = require('./index'); | ||
|
||
const helloSchema = new ApolloServer({ typeDefs, resolvers }); | ||
const server = new ApolloServer({ typeDefs, resolvers }); | ||
|
||
helloSchema.listen().then(({ url }) => { | ||
server.listen().then(({ url }) => { | ||
console.log(`schema ready at ${url}`); | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# gatsby-contentful-auth0 | ||
This is the sample music playlist application demonstrating the Gatsby + Contentful Remote Join with Hasura GraphQL. | ||
|
||
## Getting started | ||
|
||
If you've cloned this repository, navigate into the directory and install the npm modules using this command: | ||
|
||
```bash | ||
npm install | ||
``` | ||
|
||
> Note: if you clone this project through the Gatsby CLI, it will install the modules for you. | ||
## Auth0 | ||
This application uses Auth0 to manage identity. Refer to the [Auth0 integration guide](https://docs.hasura.io/1.0/graphql/manual/guides/integrations/auth0-jwt.html) for the configuration. | ||
|
||
### Modify auth config | ||
|
||
Rename `.env.EXAMPLE` to `.env.development` (or `.env.production`) and replace `<value>` for `AUTH0_DOMAIN` and `AUTH0_CLIENTID` with your Auth0 domain prefix and your client ID. These can be found on your [client dashboard](https://manage.auth0.com/#/clients). | ||
|
||
Replace the `<value>` for `AUTH0_CALLBACK` with the URL for your callback route. The default for development is `http://localhost:8000/callback`. | ||
|
||
## Contentful | ||
Contentful remote schema is added as part of the migration. Configure the environment variables in Hasura GraphQL Engine server for the types to get merged. | ||
|
||
- `CONTENTFUL_API_KEY` | ||
- `CONTENTFUL_API_ENDPOINT` which is of the format https://graphql.contentful.com/content/v1/spaces/<space-id> | ||
|
||
## Migrations | ||
|
||
Execute the following command inside `hasura` to apply the migrations | ||
|
||
```bash | ||
hasura migrate apply | ||
``` | ||
|
||
This will create all the necessary tables, relationships and remote joins. | ||
|
||
## Run the app | ||
You can start the development server with the following command: | ||
|
||
```bash | ||
gatsby develop | ||
``` | ||
|
||
The app runs at `localhost:8000` by default. | ||
|
5 changes: 5 additions & 0 deletions
5
community/sample-apps/gatsby-contentful-auth0/app/.env.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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# ./.env | ||
# Get these values at https://manage.auth0.com and create a new file called .env.development | ||
AUTH0_DOMAIN=<value> | ||
AUTH0_CLIENTID=<value> | ||
AUTH0_CALLBACK=<value> |
71 changes: 71 additions & 0 deletions
71
community/sample-apps/gatsby-contentful-auth0/app/.gitignore
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,71 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (http://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# Typescript v1 declaration files | ||
typings/ | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# dotenv environment variables file | ||
.env | ||
.env.* | ||
!.env.EXAMPLE | ||
|
||
# gatsby files | ||
.cache/ | ||
public | ||
|
||
# Mac files | ||
.DS_Store | ||
|
||
# Yarn | ||
yarn-error.log | ||
.pnp/ | ||
.pnp.js | ||
# Yarn Integrity file | ||
.yarn-integrity |
7 changes: 7 additions & 0 deletions
7
community/sample-apps/gatsby-contentful-auth0/app/.prettierrc
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 @@ | ||
{ | ||
"endOfLine": "lf", | ||
"semi": false, | ||
"singleQuote": false, | ||
"tabWidth": 2, | ||
"trailingComma": "es5" | ||
} |
28 changes: 28 additions & 0 deletions
28
community/sample-apps/gatsby-contentful-auth0/app/README.md
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,28 @@ | ||
# gatsby-contentful-auth0 | ||
This is the sample music playlist application demonstrating the Gatsby + Contentful Remote Join with Hasura GraphQL. | ||
|
||
## Getting started | ||
|
||
If you've cloned this repository, navigate into the directory and install the npm modules using this command: | ||
|
||
```bash | ||
npm install | ||
``` | ||
|
||
> Note: if you clone this project through the Gatsby CLI, it will install the modules for you. | ||
## Modify auth config | ||
|
||
Rename `.env.EXAMPLE` to `.env.development` (or `.env.production`) and replace `<value>` for `AUTH0_DOMAIN` and `AUTH0_CLIENTID` with your Auth0 domain prefix and your client ID. These can be found on your [client dashboard](https://manage.auth0.com/#/clients). | ||
|
||
Replace the `<value>` for `AUTH0_CALLBACK` with the URL for your callback route. The default for development is `http://localhost:8000/callback`. | ||
|
||
## Run the app | ||
You can start the development server with the following command: | ||
|
||
```bash | ||
gatsby develop | ||
``` | ||
|
||
The app runs at `localhost:8000` by default. | ||
|
31 changes: 31 additions & 0 deletions
31
community/sample-apps/gatsby-contentful-auth0/app/gatsby-browser.js
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,31 @@ | ||
import React from "react" | ||
import { silentAuth } from "./src/utils/auth" | ||
|
||
class SessionCheck extends React.Component { | ||
constructor(props) { | ||
super(props) | ||
this.state = { | ||
loading: true, | ||
} | ||
} | ||
|
||
handleCheckSession = () => { | ||
this.setState({ loading: false }) | ||
} | ||
|
||
componentDidMount() { | ||
silentAuth(this.handleCheckSession) | ||
} | ||
|
||
render() { | ||
return ( | ||
this.state.loading === false && ( | ||
<React.Fragment>{this.props.children}</React.Fragment> | ||
) | ||
) | ||
} | ||
} | ||
|
||
export const wrapRootElement = ({ element }) => { | ||
return <SessionCheck>{element}</SessionCheck> | ||
} |
22 changes: 22 additions & 0 deletions
22
community/sample-apps/gatsby-contentful-auth0/app/gatsby-config.js
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,22 @@ | ||
const fetch = require(`node-fetch`) | ||
const { createHttpLink } = require(`apollo-link-http`) | ||
|
||
module.exports = { | ||
plugins: [ | ||
{ | ||
resolve: 'gatsby-source-graphql', | ||
options: { | ||
typeName: 'HASURA', | ||
fieldName: 'hasura', | ||
createLink: (pluginOptions) => { | ||
return createHttpLink({ | ||
uri: 'http://localhost:8080/v1/graphql', | ||
headers: { | ||
}, | ||
fetch, | ||
}) | ||
}, | ||
}, | ||
}, | ||
] | ||
}; |
Oops, something went wrong.