Unverified Commit f3ec7bb4 authored by Lynn Foster's avatar Lynn Foster Committed by GitHub
Browse files

Merge pull request #20 from LearnDeepMilwaukee/location-create

added address parameter to place query
parents c5983a66 9a28cdf2
......@@ -14,7 +14,8 @@ from django.core.exceptions import PermissionDenied
class Query(graphene.AbstractType):
place = graphene.Field(Place,
id=graphene.Int())
id=graphene.Int(),
address=graphene.String())
all_places = graphene.List(Place)
......@@ -24,6 +25,11 @@ class Query(graphene.AbstractType):
place = Location.objects.get(pk=id)
if place:
return place
address = args.get('address')
if address is not None:
place = Location.objects.get(address=address)
if place:
return place
return None
def resolve_all_places(self, args, context, info):
......
......@@ -3073,6 +3073,19 @@ query ($token: String) {
}
}
query ($token: String) {
viewer(token: $token) {
place(address: "Anacortes, WA 98221") {
id
name
address
latitude
longitude
note
}
}
}
query ($token: String) {
viewer(token: $token) {
allPlaces {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment