Skip to content
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 library with sdl graphql schema definition and query subfields ? #8

Open
juanmafont opened this issue Jan 27, 2023 · 0 comments

Comments

@juanmafont
Copy link

juanmafont commented Jan 27, 2023

Hello.
I'm trying to use with sdl schema, like this other library -> https://github.com/taion/graphql-type-json#sdl-with-graphql-tools

My graphql sdl is:

 scalar Geometry
 
 """
  Types
 """
 type Olepoint {
     type: EnumFeature! 
     geometry: Geometry! 
     properties: Properties! 
 }

and into resolvers.ts

...
import { Geometry } from 'graphql-geojson-scalar-types';
.....
  
export const resolvers: Resolvers = {
  Geometry: Geometry,
   ......
}

But at graphql explorer can not do query with Geometry fields ->


query OlepointLatLng($apiEnd: EnumApiEnd!, $lat: Latitude!, $lng: Longitude!) {
  olepointLatLng(apiEnd: $apiEnd, lat: $lat, lng: $lng) {
    geometry {
      type
      coordinates
    }....

So is give me errors:


{
  "errors": [
    {
      "message": "Field \"geometry\" must not have a selection since type \"GeoJSONGeometryScalar!\" has no subfields.", 
....
}

It is possible use internal fields from Geometry -> type and coordinates into query ?

Thanks you very much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant