nautilus/gateway

Does it need to be explicit the Node interface?

sbilello opened this issue · 4 comments

Hello!
I was trying to make it work this gateway in this example that leverages the apollo gateway: https://github.com/Netflix/dgs-federation-example/
It looks like that performing the query

{
  shows {
    title
    reviews {
      starRating
    }
  }
}

generates this output

{
  "data": {
    "shows": [
      {
        "id": "1",
        "title": "Stranger Things"
      },
      {
        "id": "2",
        "title": "Ozark"
      },
      {
        "id": "3",
        "title": "The Crown"
      },
      {
        "id": "4",
        "title": "Dead to Me"
      },
      {
        "id": "5",
        "title": "Orange is the New Black"
      }
    ]
  },
  "errors": [
    {
      "extensions": {
        "classification": "ValidationError"
      },
      "message": "Validation error of type FieldUndefined: Field 'node' in type 'Query' is undefined @ 'node'"
    },
    {
      "extensions": {
        "classification": "ValidationError"
      },
      "message": "Validation error of type FieldUndefined: Field 'node' in type 'Query' is undefined @ 'node'"
    },
    {
      "extensions": {
        "classification": "ValidationError"
      },
      "message": "Validation error of type FieldUndefined: Field 'node' in type 'Query' is undefined @ 'node'"
    },
    {
      "extensions": {
        "classification": "ValidationError"
      },
      "message": "Validation error of type FieldUndefined: Field 'node' in type 'Query' is undefined @ 'node'"
    },
    {
      "extensions": {
        "classification": "ValidationError"
      },
      "message": "Validation error of type FieldUndefined: Field 'node' in type 'Query' is undefined @ 'node'"
    }
  ]
}

I was comparing the schema it looks like that the problem can be given by implementing the Node type?
Is this gateway referring to an old apollo gateway federation spec?

Hey @sbilello - sorry to hear you are running into some difficulty.

For context, this gateway does not implement apollo's spec. In fact, it predates the public release of the spec and i'm not very familiar with what they have done with their gateway. I know that in general, nautilus put a much heavier dependency on the node field, you can't really customize it the way you can apollo's. The validation error that you show is not coming from the gateway so I'm not really sure what the source is.

Sorry i couldn't be more help!

@AlecAivazis thanks for confirming it. Yes, the validation error is coming from the subgraph because they expect another kind of query format. Is there a reason why it is not conforming to the apollo federation spec?

Like I mentioned, this project was released before their federation spec. the nautilius gateway is built by relying on the Node interface to handle the actual stitching and querying which seems like a much simpler constraint on the backing services instead of relying on an entire family of introspection queries. to be clear, I dont have plans to adopt their spec in the future either

Thanks for your fast reply and clarification!