Commit Graph

789 Commits

Author SHA1 Message Date
nizar-m
a40bf10b9f run graphql tests on both http and websocket; add parallelism (close #1868) (#1921)
Examples 
1)  `
pytest --hge-urls "http://127.0.0.1:8080" --pg-urls "postgresql://admin@127.0.0.1:5432/hge_tests" -vv
`
2)  `pytest --hge-urls "http://127.0.0.1:8080"   "http://127.0.0.1:8081" --pg-urls "postgresql://admin@127.0.0.1:5432/hge_tests"  "postgresql://admin@127.0.0.1:5432/hge_tests2" -vv
`
### Solution and Design
<!-- How is this issue solved/fixed? What is the design? -->
<!-- It's better if we elaborate -->
#### Reducing execution time of tests
- The Schema setup and teardown, which were earlier done per test method, usually takes around 1 sec. 
- For mutations, the model has now been changed to only do schema setup and teardown once per test class.
-  A data setup and teardown will be done once per test instead (usually takes ~10ms).
- For the test class to get this behaviour, one can can extend the class `DefaultTestMutations`. 
    - The function  `dir()` should be define which returns the location of the configuration folder.
    - Inside the configuration folder, there should be 
        - Files `<conf_dir>/schema_setup.yaml` and `<conf_dir>/schema_teardown.yaml`, which has the metadata query executed during schema setup and teardown respectively
        - Files named `<conf_dir>/values_setup.yaml` and `<conf_dir>/values_teardown.yaml`. These files are executed to setup and remove data from the tables respectively. 

#### Running Graphql queries on both http and websockets
- Each GraphQL query/mutation is run on the both HTTP and websocket protocols
- Pytests test parameterisation is used to achieve this
- The errors over websockets are slightly different from that on HTTP
   - The code takes care of converting the errors in HTTP to errors in websockets

#### Parallel executation of tests.
- The plugin pytest-xdist helps in running tests on parallel workers.
- We are using this plugin to group tests by file and run on different workers.
- Parallel test worker processes operate on separate postgres databases(and separate graphql-engines connected to these databases). Thus tests on one worker will not affect the tests on the other worker.
- With two workers, this decreases execution times by half, as the tests on event triggers usually takes a long time, but does not consume much CPU.
2019-04-08 12:52:38 +05:30
Rakesh Emmadi
3708f95036 fix input argument types for custom SQL functions (close #1952) (#1953) 2019-04-08 12:28:56 +05:30
Gordon Johnston
a7eabe034c mention required key length for HMAC encryption to user (#1956)
Following on from a discussion in discord, a small tweak to make the required key length for a HMAC key more obvious
2019-04-06 08:20:16 +05:30
Tirumarai Selvan
cab1aa0cb1 fix update_event_trigger query not persisting the changes (#1950)
fix #1949
2019-04-05 17:50:46 +05:30
Vladimir Novick
1575519224 add realtime chat sample app with vue (#1885) 2019-04-05 12:16:29 +05:30
Rishichandra Wawhal
c964c90a7b persist queries in GraphiQL (closes #1894) (#1903) 2019-04-03 19:43:09 +05:30
Praveen Durairaj
39b623f715 add nextjs 8 jwt sample app (#1943) 2019-04-03 19:21:11 +05:30
Anne Ogborn
44d6bb8b7e improve console error page (close #272) (#1890) 2019-04-03 19:08:17 +05:30
Rishichandra Wawhal
abfe7ae88f firebase2graphql (v0.0.2): support array types in firebase json (close #1829) (#1900) 2019-04-03 17:11:28 +05:30
Aravind Shankar
5f02ebdefa added feedback on migration commands (close #1410) (#1931) 2019-04-03 16:59:58 +05:30
Rikin Kachhia
56c67509aa
update track relationship text in console (#1927) 2019-04-03 15:07:14 +05:30
Rikin Kachhia
29d6e85e42
add better upsert example to docs (#1930) 2019-04-03 15:05:51 +05:30
Aravind Shankar
f147f6d6a6 improve error messages for metadata apply (close #1877) (#1895) 2019-04-03 12:27:59 +05:30
Aravind Shankar
1e20026ea2 added feedback for metadata commands (close #1411) (#1929) 2019-04-03 11:22:03 +05:30
Tirumarai Selvan
d53c70cbcd specify better error msgs for remote schema conflicts (fix #1805) (#1904) 2019-04-03 06:48:19 +05:30
Rikin Kachhia
1c6e962776
remove remote schema env var note (#1932) 2019-04-02 16:44:02 +05:30
Rikin Kachhia
b5188e79f4
update raw sql notes and tooltips (#1926) 2019-04-02 15:58:06 +05:30
Rikin Kachhia
e80a58faac
refactor some console components for readability (#1928) 2019-04-02 15:45:38 +05:30
Dave A-W
c621ecc610 fix minimum pg disk value on azure template (#1913)
Minimum postgres disk size is 5120 MB rather than 5210.  Specifying 5210 results in an ARM deployment error.
2019-04-02 07:48:56 +05:30
Evert Smit
503190d1dc Fix Docker for Mac DNS name in remote schema docs (#1923) 2019-04-02 07:25:58 +05:30
Karthik Venkateswaran
8221653237 make graphiql api endpoint and request header sections collapsible (#1723) 2019-04-01 18:45:29 +05:30
dsandip
d451b56d78 update permissions ref docs to include all config keys (#1918) 2019-04-01 14:28:39 +05:30
Praveen Durairaj
8e78e27707 add vuejs-auth0-graphql sample app (#1898)
This is a sample Vue.js app with Auth0 integration. Has a simple schema with users and article tables with permissions setup. Once the user logs in to the app, the articles written by the user would be shown.
2019-03-29 12:22:59 +05:30
Aravind Shankar
ca7d8b3df5 rename metadata reset to metadta clear (close #1851) (#1893)
The word "reset" is little ambiguous (reset to scratch or reset to last known consistent state). metadata reset clears the all the metadata to mimic a freshly installed hasura instance. This actually invokes the clear_metadata API in the backend and hence should also be called metadata clear for perfect clarity.

All references to metadata reset should be changed to metadata clear.
2019-03-29 10:44:56 +05:30
Shahidh K Muhammed
7bfcc764db update migration, api-reference docs (close #766) (close #1345) (close #1496) (#1701) 2019-03-28 16:21:58 +05:30
Simone Busoli
f6c11e545d fix bash completion example docs on cli (#1832) 2019-03-28 07:28:20 +05:30
Shahidh K Muhammed
9630149663 npm security fixes 2019-03-27 22:08:43 +05:30
Shahidh K Muhammed
42a25f044e
add script and now.sh function to edit pg_dump output (close #1861) (#1884)
<!-- Thank you for submitting this PR! :) -->
<!-- Provide a general summary of your changes in the Title above ^, end with (close #<issue-no>) or (fix #<issue-no>) -->

### Description
<!-- The title might not be enough to convey how this change affects the user. -->
<!-- Describe the changes from a user's perspective -->
This PR adds a bash script and a serverless function to clean up the output of `pg_dump` so that it can be used as a migration file for Hasura. This can be later integrated with the CLI so that the cleanup is handled by CLI.

### Affected components 
<!-- Remove non-affected components from the list -->

- Scripts

### Related Issues
<!-- Please make sure you have an issue associated with this Pull Request -->
<!-- And then add `(close #<issue-no>)` to the pull request title -->
<!-- Add the issue number below (e.g. #234) -->
#1861 
### Solution and Design
<!-- How is this issue solved/fixed? What is the design? -->
<!-- It's better if we elaborate -->
- A serverless function written in Go gets the SQL content though HTTP POST.
- A set of pre-defined lines are removed from this SQL string.
- SQL comments are removed using regex matching.
- Postgres triggers created by Hasura for use with event triggers are removed with regex matching.
- Empty newlines are removed by regex matching.
- Resulting string is returned in the HTTP response.
### Steps to test and verify
<!-- If this is a feature, what are the steps to try them out? -->
<!-- If this is a bug-fix, how do we verify the fix? -->
```bash
curl --data-binary @filename.sql https://hasura-edit-pg-dump.now.sh > newfile.sql
```

### Limitations, known bugs & workarounds
<!-- Limitations of the PR, known bugs and suggested workarounds -->
NA
<!-- Feel free to delete these comment lines -->
2019-03-27 21:36:58 +05:30
Rishichandra Wawhal
c7fdf013fa firebase2graphql(v0.0.1-alpha8) example usage fix (#1881) 2019-03-27 15:22:00 +05:30
comerc
6585e3d78f fix a typo in boilerplates/auth-webhooks/passport-js (#1351) 2019-03-27 14:17:23 +05:30
Rishichandra Wawhal
9dc833c808 add visual studio code integration guide to docs (close #1656) (#1828)
add visual studio code guide to docs (close #1656)
2019-03-27 14:07:54 +05:30
samuela
0f57e4cb4d update jwt docs (#1850) 2019-03-27 14:02:47 +05:30
Praveen Durairaj
b3bf0b029d graphiql-online upgrade deployment to now 2.0 (close #1838) (#1858) 2019-03-27 13:56:04 +05:30
Vamshi Surabhi
ada35c2236 add user information to transactions in ws protocol (fix #1867) (#1869)
This bug introduced with the refactor in 739ff80a51.
2019-03-26 16:38:27 +05:30
Vamshi Surabhi
8e9a6a25a9 bump haskell-docker-packager version (#1870)
The previous version didn't include libgcc_s.so.1 in rootfs. We never encountered an error before as it was most likely packaged by busybox.
2019-03-26 15:26:15 +05:30
Praveen Durairaj
26ed94fb19 add vuetify-vuex-todo-graphql sample app (#1866) 2019-03-26 14:36:46 +05:30
Takeshi Amano
c344899976 add japanese translation for readme (#1833) 2019-03-26 11:15:46 +05:30
Shahidh K Muhammed
058fc61a05 update manifests to v1.0.0-alpha41 2019-03-26 10:33:01 +05:30
Vamshi Surabhi
739ff80a51 refactor graphql query execution logic (#1855) 2019-03-25 23:55:25 +05:30
Tirumarai Selvan
36781199d0 breaking: drop id from event_triggers table (fix #1840) (#1857) 2019-03-25 22:40:52 +05:30
Karthik Venkateswaran
d93e3b533c use inflection to suggest relationship names (close #1665) (#1801)
This breaks existing behaviour on how relationship names are generated.
2019-03-25 20:25:24 +05:30
Toan Nguyen
560c31f9fd add a json path argument to query values inside json columns (close #1598) (#1661) 2019-03-25 19:15:35 +05:30
Shahidh K Muhammed
b8700cce70
add spatial predicates for geography columns (close #1674) (#1735)
This PR adds support for PostGIS spatial predicates on geography columns. The predicates are _st_d_within and _st_intersects.
2019-03-25 17:59:52 +05:30
Rikin Kachhia
1ba382193e update console and docs favicons (close #1485) (#1760) 2019-03-25 15:42:56 +05:30
Vamshi Surabhi
d61c90f1b7
validate relationship definitions on startup (#1849) 2019-03-25 14:26:29 +05:30
Shahidh K Muhammed
2274e2748b Revert "reduce server build time on ci (#1836)"
This reverts commit cbd6bb1f15.
2019-03-25 09:49:23 +05:30
Anon Ray
cbd6bb1f15 reduce server build time on ci (#1836)
Due to a misconfiguration in the caching logic, a server was building dependencies on every build. This fixes it to reduce server build time.
2019-03-22 18:11:15 +05:30
Rakesh Emmadi
5bafdce9a3 fix delete mutation returning incorrect data (fix #1794) (fix #1763) (#1827)
From `alpha-40` we've been using a `WHERE` clause to fetch required rows and generate mutation response. This has a few limitations like the requirement of a primary key/unique constraint. This also returns inconsistent data on `delete` mutation as mentioned in #1794. 
Now, we're using `VALUES (..)` (refer [here](https://www.postgresql.org/docs/current/sql-values.html)) expression to form virtual table rows in `SQL` to generate mutation response.

Internal changes:-
- Not to use primary key/unique constraint columns:-
  - Revert back to `ConstraintName` from `TableConstraint` in `TableInfo` type
  - Remove `tcCols` field in `TableConstraint` type
  - Modify `table_info.sql` and `fetchTableMeta` function `SQL`
- A test case to perform `delete` mutation and returning relational objects.
2019-03-22 12:38:42 +05:30
Praveen Durairaj
420dde77dc add auth0 tutorial link to react-apollo-todo landing page (#1819) 2019-03-22 12:28:20 +05:30
Tirumarai Selvan
ed9a5b962a add rest-wrapper remote schema boilerplate (#1826) 2019-03-20 16:15:45 +05:30