-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set up a demo GraphQL query and component (#5)
Fixes #4.
- Loading branch information
1 parent
b91be6c
commit 99a4104
Showing
18 changed files
with
92 additions
and
26 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# See https://pre-commit.com for more information | ||
# See https://pre-commit.com/hooks.html for more hooks | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v3.2.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: check-yaml | ||
- repo: https://github.com/psf/black | ||
rev: 23.3.0 | ||
hooks: | ||
- id: black | ||
- repo: https://github.com/pre-commit/mirrors-eslint | ||
rev: 'v7.15.0' # Use the sha / tag you want to point at | ||
hooks: | ||
- id: eslint | ||
files: \.[jt]sx?$ # *.js, *.jsx, *.ts and *.tsx | ||
types: [file] | ||
args: ["--fix"] | ||
additional_dependencies: | ||
- eslint@7.15.0 | ||
- eslint-config-standard@16.0.2 | ||
- eslint-plugin-import@2.22.1 | ||
- eslint-plugin-node@11.1.0 | ||
- eslint-plugin-promise@4.2.1 | ||
- eslint-plugin-react@7.21.5 |
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 +1 @@ | ||
# fitbit-challenges | ||
# fitbit-challenges |
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 |
---|---|---|
@@ -1,10 +1,21 @@ | ||
from graphql import GraphQLObjectType, GraphQLSchema | ||
from graphql import GraphQLObjectType, GraphQLSchema, GraphQLField, GraphQLString | ||
|
||
|
||
def get_test_field(*args, **kwargs) -> str: | ||
return "hello world!" | ||
|
||
|
||
def Schema(models): | ||
return GraphQLSchema( | ||
query=GraphQLObjectType( | ||
name="RootQueryType", | ||
fields={}, | ||
name="Query", | ||
fields={ | ||
"test": GraphQLField( | ||
GraphQLString, | ||
args={}, | ||
resolve=get_test_field, | ||
description="Test field", | ||
) | ||
}, | ||
) | ||
) |
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 +1 @@ | ||
Generic single-database configuration. | ||
Generic single-database configuration. |
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,9 +1,11 @@ | ||
Flask | ||
Flask-Migrate | ||
Flask>=2.2 | ||
Flask-Migrate>=4.0.4 | ||
psycopg2 | ||
pylint | ||
sqlalchemy | ||
Flask-SQLAlchemy | ||
graphql-core==2.2 | ||
flask_graphql | ||
Flask-SQLAlchemy>=3.0.3 | ||
graphql-core | ||
git+https://github.com/graphql-python/graphql-server@8b9639e1575a20c7322fb8f19459d743d7201410#egg=graphql-server[flask] | ||
flask-cors | ||
black | ||
pre-commit | ||
black |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,8 +1,13 @@ | ||
import { render, screen } from '@testing-library/react'; | ||
import App from './App'; | ||
import { MockedProvider } from '@apollo/react-testing'; | ||
|
||
test('renders hello world', () => { | ||
render(<App />); | ||
const linkElement = screen.getByText(/Hello world/i); | ||
it('should render loading state initially', () => { | ||
render( | ||
<MockedProvider mocks={[]}> | ||
<App /> | ||
</MockedProvider>, | ||
); | ||
const linkElement = screen.getByText(/Loading/i); | ||
expect(linkElement).toBeInTheDocument(); | ||
}); |
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 |
---|---|---|
|
@@ -28,4 +28,4 @@ const DatePicker = (props) => { | |
); | ||
} | ||
|
||
export default DatePicker; | ||
export default DatePicker; |
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 |
---|---|---|
|
@@ -39,4 +39,3 @@ const MultiSelect = (props) => { | |
); | ||
} | ||
export default MultiSelect; | ||
|
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 |
---|---|---|
|
@@ -109,4 +109,3 @@ const TransactionFilters = (props) => { | |
) | ||
} | ||
export default TransactionFilters; | ||
|
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 |
---|---|---|
|
@@ -89,4 +89,4 @@ const TransactionList = (props) => { | |
); | ||
} | ||
|
||
export default TransactionList; | ||
export default TransactionList; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
|
@@ -8,4 +8,3 @@ module.exports = { | |
}, | ||
plugins: [], | ||
} | ||
|