Skip to content

Commit

Permalink
implemented graphql
Browse files Browse the repository at this point in the history
  • Loading branch information
apoorvpandey0 committed Oct 15, 2021
1 parent 40de21d commit 30b761f
Show file tree
Hide file tree
Showing 6 changed files with 170 additions and 0 deletions.
138 changes: 138 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/
1 change: 1 addition & 0 deletions banks/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
'import_export',
'rest_framework',
'django_filters',
"graphene_django",
]

MIDDLEWARE = [
Expand Down
3 changes: 3 additions & 0 deletions banks/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@
"""
from django.contrib import admin
from django.urls import path,include
from graphene_django.views import GraphQLView
from ifscfinder.schema import schema

urlpatterns = [
path('admin/', admin.site.urls),
path('home/',include('ifscfinder.urls'),name='ifscfinder'),
path('', include('ifscfinder.api.urls'),name = 'api-Bank'),
path("graphql", GraphQLView.as_view(graphiql=True,schema = schema),name='graphql'),
]
Binary file modified db.sqlite3
Binary file not shown.
19 changes: 19 additions & 0 deletions ifscfinder/schema.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import graphene
from graphene_django import DjangoObjectType
from .models import Bank


class BankType(DjangoObjectType):
class Meta:
model = Bank
fields =("id","bank_name",'bank_id','district','state','branch','ifsc','city','address')


class Query(graphene.ObjectType):

all_banks = graphene.List(BankType)

def resolve_all_banks(self, info):
return Bank.objects.all()

schema = graphene.Schema(query=Query)
9 changes: 9 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
aniso8601==7.0.0
asgiref==3.2.10
defusedxml==0.6.0
diff-match-patch==20181111
Expand All @@ -6,19 +7,27 @@ django-filter==2.3.0
django-import-export==2.2.0
djangorestframework==3.11.2
et-xmlfile==1.0.1
graphene==2.1.9
graphene-django==2.15.0
graphql-core==2.3.2
graphql-relay==2.0.1
gunicorn==20.0.4
jdcal==1.4.1
MarkupPy==1.14
numpy==1.19.0
odfpy==1.4.1
openpyxl==3.0.4
pandas==1.0.5
promise==2.3
python-dateutil==2.8.1
pytz==2020.1
PyYAML==5.4
Rx==1.6.1
singledispatch==3.7.0
six==1.15.0
sqlparse==0.3.1
tablib==2.0.0
text-unidecode==1.3
whitenoise==5.1.0
xlrd==1.2.0
xlwt==1.3.0

0 comments on commit 30b761f

Please sign in to comment.