Skip to content

meniRoy/graphql-geojson-scalar-types

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

graphql-geojson-scalar-types

GraphQL schema scalar types for GeoJSON. Based on GeoJSON Validation.

Installation

npm i -S graphql-geojson-scalar-types

or with Yarn:

yarn add graphql-geojson-scalar-types

Usage

import { GraphQLObjectType, GraphQLSchema } from 'graphql'
import { Point } from 'graphql-geojson-scalar-types'

export default new GraphQLSchema({
  query: new GraphQLObjectType({
    name: 'Query',
    fields: () => ({
      point: {
        type: Point,
        resolve: () => ({
          type: 'Point',
          coordinates: [-105.01621, 39.57422],
        }),
      },
    }),
  }),
})

Then you can query it like this:

query {
  point
}

Demo

An example GraphQL server implementation is available here: demo

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%