title: How to query a geojson point with GraphQl?
body: <p>I'm working with nodejs, mongoose and graphql and I have geojson 2D coordinates in my db but I'm unable to query them throught graphql it always returns <code>null</code></p>
  
  <p>I've tried with the <code>PointObject</code> schema  from <a href="https://github.com/ghengeveld/graphql-geojson" rel="nofollow noreferrer">https://github.com/ghengeveld/graphql-geojson</a> to replace my <code>Geometry</code> schema but same issue</p>
  
  <p>My code :</p>
  
  <pre><code>const Geometry = new GraphQLObjectType({
    name: 'Geometry',
    fields: () =&gt; ({
      type: {
        type: GraphQLString
      },
      coordinates: {
        type: new GraphQLList(GraphQLFloat)
      },
    }),
  })
  
  const AntenneType = new GraphQLObjectType({
    name: 'AntenneType',
    fields: () =&gt; ({
      _id: {
        type: GraphQLID
      },
      type: {
        type: GraphQLString
      },
      geometry: {
        type: Geometry
      },
      properties: {
        type: Properties
      }
    }),
  });
  
  const query = new GraphQLObjectType({
    name: 'Query',
    fields: {
      antennes: {
        type: new GraphQLList(AntenneType),
        resolve: (obj, args, context, info) =&gt; {
          return Antenne.find().limit(2) //Antenne is my mongoose model that return same data as in the data.json file
            .then(antennes =&gt; {
              console.log(antennes)
              return antennes
            })
        }
      }
    },
  });
  </code></pre>
  
  <p>One set of data :</p>
  
  <pre><code> {
      "properties": {
        ...
      },
      "geometry": {
        "type": "Point",
        "coordinates": [
          2.231666666667,
          49.223611111111
        ]
      },
      "_id": "5cf1901b228293201fe248dc",
      "type": "Feature"
    }
  </code></pre>
  
  <p>My GraphQl query:</p>
  
  <pre><code>query{
    antennes{
      _id
      properties{
        generation
        adm_lb_nom
      }
      geometry{
        coordinates 
      }
    }
  }
  </code></pre>
  
  <p>And the result :</p>
  
  <pre><code>{
    "data": {
      "antennes": [
        {
          "_id": "5cf1901b228293201fe248dc",
          "properties": {
            "generation": "2G",
            "adm_lb_nom": "SFR"
          },
          "geometry": {
            "coordinates": null
          }
        }
      ]
    }
  }
  </code></pre>
  
  <p>I've also made a gist with my full schemas and data : <a href="https://gist.github.com/yadPe/cb397175a8c39021d0dab2208fe22a4d" rel="nofollow noreferrer">https://gist.github.com/yadPe/cb397175a8c39021d0dab2208fe22a4d</a></p>
  
  <p>My mongoose schema (edited according to @DanielRearden answer): </p>
  
  <pre><code>const geoSchema = new Schema({
      type: {
          type: String,
          enum: ['Point'],
          required: true
      },
      coordinates: {
          type: [Number],
          required: true
      }
  });
  
  const antenneSchema = new Schema({
      type: String,
      properties: {
          sup_id: Number,
          tpo_id: Number,
          sta_nm_dpt: String,
          adr_nm_cp: Number,
          generation: String,
          coordonnees: String,
          sup_nm_haut: Number,
          adm_lb_nom: String,
          emr_lb_systeme: String,
          coord: String,
          emr_dt_service: String,
          date_maj: String,
          code_insee: String,
          nat_id: Number,
          _id: Number,
          com_cd_insee: String,
          id: Number,
          total_de_adm_lb_nom: String,
          sta_nm_anfr: String
      },
      geometry: {
          geoSchema
      }
  }, { collection: '2G_France' });
  
  module.exports = mongoose.model('Antenne', antenneSchema);
  </code></pre>
  
  <p>I did some console logging of the data returned by mongoose:</p>
  
  <pre><code>Antenne.find().limit(1)
    .then(antennes =&gt; {
      //return antennes
      return antennes.map(antenne =&gt; {
        console.log(antenne.geometry)
        console.log(typeof antenne.geometry)
        console.log(antenne.geometry.type)
        console.log(antenne.geometry.coordinates)
        const test = JSON.parse(JSON.stringify(antenne.geometry)) // idk why I need to do that here
        console.log(test.type)
        console.log(test.coordinates)
        return antenne
      })
    });
  </code></pre>
  
  <p>And got the following result:</p>
  
  <pre><code>{ type: 'Point',
    coordinates: [ 2.323333333333, 48.346666666667 ] }
  object
  undefined
  undefined
  Point
  [ 2.323333333333, 48.346666666667 ]
  </code></pre>