ghengeveld / graphql-geojson Goto Github PK
View Code? Open in Web Editor NEWGraphQL schema object types for GeoJSON
GraphQL schema object types for GeoJSON
When I attempt to do this:
import {
GeometryInterface
} from 'graphql-geojson'
I get the following error:
error TS7016: Could not find a declaration file │
for module 'graphql-geojson'. '/path/to/node_modules/graphql-geojson/i│
ndex.js' implicitly has an 'any' type.
The same issue arises irrespective of whether I import GeometryInterface
or PointObject
or any of the other exported elements.
This error
Could not find possible implementing types for GeoJSONGeometryInterface in schema. Check that schema.types is defined and is an array of all possible types in the schema.
will appear if you just have FeatureObject in your fields. You can easily reproduce this if you use your own demo https://github.com/ghengeveld/graphql-geojson-demo and change the code.
You have to change the file src/schema.js
and set your schema to:
export default new GraphQLSchema({
query: new GraphQLObjectType({
name: 'Query',
fields: () => ({
feature: {
type: FeatureObject,
resolve: () => feature,
},
}),
}),
})
If you now try to query and just want to get back the feature you will get the error I have copied above.
Please include the style
property, as described here: http://wiki.openstreetmap.org/wiki/Geojson_CSS
Is there a straightforward way to use these in mutations? I have tried converting them straight to input types with graphql-compose but it seems to have some problems with the Union type in the CRS field. Additionally / alternatively, could you make the CRS field optional? It is optional in the spec.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.