-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using of this module makes types to be incompatible with custom interfaces #4
Comments
Hi @artemnesterenko, All declared fields from a Could you paste the code for the Searchable interface? |
Hi @mongkok! from django.contrib.gis.db import models
from graphene import Interface, NonNull, String, Node
import graphql_geojson
class MyModel(models.Model):
name = models.CharField(max_length=32, blank=False, null=False)
location = models.MultiPolygonField(blank=True, null=True)
class Searchable(Interface):
display_name = NonNull(String)
class MyGeoType(graphql_geojson):
display_name = NonNull(String)
def resolve_display_name(self, info, **kwargs):
return self.name
class Meta:
model = MyModel
geojson_field = 'location'
interfaces = (Node, Searchable) So, interface fields can be defined not only in models themselves but also in GraphQL types. |
Any update on this? |
Hi @artemnesterenko, Graphene interfaces are not compatible for GeoJSONType. |
I have several types for which I want to make a search. I've created a Searchable interface which requires a
displayName
field to be in a type and I've added the field to all appropriate types. But a type inherited from GeoJSONType doesn't conform to the Searchable interface eventually, because it'sdisplayName
is located in properties. How can I make things work properly?The text was updated successfully, but these errors were encountered: