Skip to content

Commit

Permalink
Merge branch 'master' into docs/4419
Browse files Browse the repository at this point in the history
  • Loading branch information
tirumaraiselvan authored Apr 21, 2020
2 parents 453ad51 + 5f84669 commit 1a1348d
Show file tree
Hide file tree
Showing 17 changed files with 11,354 additions and 211 deletions.
8 changes: 4 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

### Bug fixes and improvements

- docs: add API docs for `webhook_from_env` in event triggers
- server: add support for `_inc` on `real`, `double`, `numeric` and `money` (fix #3573)
- server: support special characters in JSON path query argument with bracket `[]` notation, e.g `obj['Hello World!']` (#3890) (#4482)
- docs: add API docs for using environment variables as webhook urls in event triggers

## `v1.2.0-beta.4`

Expand Down Expand Up @@ -38,7 +40,6 @@ The order, collapsed state of columns and page size is now persisted across page
- console: add undefined check to fix error (close #4444) (#4445)
- console: change react ace editor theme to eclipse (close #4437)
- docs: add One-Click Render deployment guide (close #3683) (#4209)
- server: add support for `_inc` on `real`, `double`, `numeric` and `money` (fix #3573)
- server: reserved keywords in column references break parser (fix #3597) #3927
- server: fix postgres specific error message that exposed database type on invalid query parameters (#4294)
- server: manage inflight events when HGE instance is gracefully shutdown (close #3548)
Expand All @@ -47,7 +48,7 @@ The order, collapsed state of columns and page size is now persisted across page
- server: `type` field is not required if `jwk_url` is provided in JWT config
- server: add a new field `claims_namespace_path` which accepts a JSON Path for looking up hasura claim in the JWT token (#4349)
- server: support reusing Postgres scalars in custom types (close #4125)

## `v1.2.0-beta.3`

### console: manage Postgres check constraints
Expand Down Expand Up @@ -164,5 +165,4 @@ Read more about it in the [docs](https://hasura.io/docs/1.0/graphql/manual/auth/

- server: check expression in update permissions (close #384) (rfc #3750) (#3804)
- console: show pre-release update notifications with opt out option (#3888)
- Allow special characters in JSON path query argument with bracket `[]` notation, e.g `obj['Hello World!']` (#3890)
- console: handle invalid keys in permission builder (close #3848) (#3863)
2 changes: 1 addition & 1 deletion community/sample-apps/realtime-chat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ This is the source code for a fully working group chat app that uses subscriptio
- [Fully working app](https://realtime-chat.demo.hasura.app/)
- [Backend](https://realtime-chat.demo.hasura.app/console)

For a complete tutorial about data modelling, [check out this blog](https://hasura.io/docs/building-a-realtime-chat-app-with-graphql-subscriptions-d68cd33e73f).
For a complete tutorial about data modelling, [check out this blog](https://hasura.io/blog/building-a-realtime-chat-app-with-graphql-subscriptions-d68cd33e73f).

26 changes: 19 additions & 7 deletions community/sample-apps/realtime-poll/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"apollo-boost": "^0.1.13",
"apollo-boost": "^0.4.7",
"apollo-cache-inmemory": "^1.2.7",
"apollo-client": "^2.3.8",
"apollo-link": "^1.2.2",
"apollo-link-http": "^1.5.4",
"apollo-link-ws": "^1.0.8",
"apollo-utilities": "^1.0.18",
"graphql": "^0.13.2",
"graphql": "^15.0.0",
"react": "^16.4.2",
"react-apollo": "^2.1.11",
"react-bootstrap": "^0.32.1",
"react-apollo": "^3.1.4",
"react-bootstrap": "^1.0.0",
"react-dom": "^16.4.2",
"react-google-charts": "^3.0.5",
"react-scripts": "1.1.4",
"react-scripts": "^3.4.1",
"subscriptions-transport-ws": "^0.9.14"
},
"scripts": {
Expand All @@ -28,7 +28,19 @@
"eject": "react-scripts eject"
},
"devDependencies": {
"eslint-plugin-jsx-a11y": "5.1.1",
"gh-pages": "^1.2.0"
"eslint-plugin-jsx-a11y": "^6.2.3",
"gh-pages": "^2.2.0"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
7 changes: 6 additions & 1 deletion community/sample-apps/realtime-poll/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@
Learn how to configure a non-root public URL by running `npm run build`.
-->
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link
rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh"
crossorigin="anonymous"
/>
<title>Realtime Poll | Powered by Hasura GraphQL Engine</title>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-129818961-1"></script>
Expand Down
50 changes: 24 additions & 26 deletions community/sample-apps/realtime-poll/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
color: white;
text-align: left;
}
.App-footer{
height: 50px;
text-align: center;
width: 100%;
margin-bottom: 30px;
margin-top: 30px;
.App-footer {
height: 50px;
text-align: center;
width: 100%;
margin-bottom: 30px;
margin-top: 30px;
}

.App-title {
Expand All @@ -44,36 +44,31 @@
.App-intro {
font-size: large;
}
.pollWrapper
{
padding-top: 10px;

.cardGraphQL {
padding-top: 50px;
}
.pollForm
{

.pollWrapper {
padding-top: 10px;
}
pre
{

pre {
font-size: 10px;
text-align: left;
margin: 25px 0;
}
.voteBtn
{

}
.radio
{
.radio {
margin-bottom: 15px;
}
.textLeft
{

.textLeft {
text-align: left;
}
.wd100
{

.wd100 {
width: 100%;
float: left;
}
@keyframes App-logo-spin {
from { transform: rotate(0deg); }
Expand All @@ -86,7 +81,10 @@ pre
}

.online-users {
padding-top: 20px;
justify-content: center;
text-align: center;
width: 100%;
margin-top: 30px;
}
.online-users .alert {
margin-bottom: 0px;
Expand All @@ -98,7 +96,7 @@ pre
justify-content: center;
max-width: 900px;
width: 100%;
min-height: 400px;
min-height: 350px;
}

@media(max-width: 767px) {
Expand All @@ -109,4 +107,4 @@ pre

.hasura-logo img {
margin-bottom: 12px;
}
}
17 changes: 10 additions & 7 deletions community/sample-apps/realtime-poll/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,27 @@ import React, { Component } from 'react';
import logo from './img/logo-white.svg';
import './App.css';
import { ApolloProvider } from 'react-apollo';
import client, {HASURA_GRAPHQL_ENGINE_HOSTNAME} from './apollo';
import client from './apollo';
import Poll from './Poll';
import { getUserId } from './session';
import { GraphQL } from './GraphQL';
import { Users } from './Users';


class App extends Component {
constructor (props) {
constructor(props) {
super(props);
this.state = {loading: true, userId: ''};
this.state = { loading: true, userId: '' };
}

componentWillMount() {
componentDidMount() {
getUserId().then((userId) => {
this.setState({loading: false, userId});
this.setState({ loading: false, userId });
});
}

render() {
if (this.state.loading) return <p>Loading...</p>;
// if (this.state.loading) return <p>Loading...</p>;
return (
<ApolloProvider client={client}>
<div className="App">
Expand All @@ -32,8 +34,9 @@ class App extends Component {
</div>
</header>

<Users />

<Poll userId={this.state.userId}/>
<Poll userId={this.state.userId} />

<GraphQL />

Expand Down
40 changes: 19 additions & 21 deletions community/sample-apps/realtime-poll/src/GraphQL.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react';
import { Panel } from 'react-bootstrap';
import { Card } from 'react-bootstrap';

const QUERY_GET_POLL = `
query {
poll {
poll (limit: 10) {
id
question
options (order_by: {id:desc}){
Expand Down Expand Up @@ -71,38 +71,36 @@ mutation newUser($uuid: uuid) {

const GraphQL = () => (
<div className="container">
<div className="col-md-12">
<Panel>
<Panel.Heading>
<Panel.Title componentClass="h3">GraphQL Queries/Mutations/Subscriptions in this page</Panel.Title>
</Panel.Heading>
<Panel.Body>
<div className="row">
<div className="col-md-4">
Get the Poll question and options:
<div className="col-md-12 cardGraphQL">
<Card>
<Card.Header>GraphQL Queries/Mutations/Subscriptions in this page</Card.Header>
<Card.Body>
<div className="row">
<div className="col-md-4">
Get the Poll question and options:
<pre>{QUERY_GET_POLL}</pre>

Create a new user:
<pre>{MUTATION_NEW_USER}</pre>
</div>
<div className="col-md-4">
Cast a vote:
</div>
<div className="col-md-4">
Cast a vote:
<pre>{MUTATION_VOTE}</pre>

Mark user online:
<pre>{MUTATION_MARK_USER_ONLINE}</pre>
</div>
<div className="col-md-4">
Show live results:
</div>
<div className="col-md-4">
Show live results:
<pre>{SUBSCRIPTION_RESULT}</pre>

Get real-time number of users:
<pre>{SUBSCRIPTION_ONLINE_USERS}</pre>
</div>
</div>
</div>
</Panel.Body>
</Panel>
</div>
</Card.Body>
</Card>
</div>
</div>
)

Expand Down
Loading

0 comments on commit 1a1348d

Please sign in to comment.