Comments (4)
Hi @artemnesterenko,
All declared fields from a GeoJSONType
class are moved to properties
field, we could add a field within GeoJSONType.Meta
to exclude some properties
.
Could you paste the code for the Searchable interface?
from django-graphql-geojson.
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.
from django-graphql-geojson.
Any update on this?
from django-graphql-geojson.
Hi @artemnesterenko,
I am sorry for the long long delay to response.
Graphene interfaces are not compatible for GeoJSONType.
I am trying to move the interfaces fields within the properties
field but I can not find an easy way to do this, I will keep you updated with new changes
from django-graphql-geojson.
Related Issues (9)
- __init_subclass_with_meta__() got multiple values for keyword argument '_meta' HOT 3
- Add a default description to Geometry type HOT 2
- What if a model has more geodjango fields? HOT 8
- Returning valid GeoJSON HOT 1
- Is not clear in README which versions of Graphene Django supports
- Problems with distance_Lte Filter HOT 3
- This module doesn't support two endpoints based on the same model
- Is this still maintained?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-graphql-geojson.