Code Monkey home page Code Monkey logo

Comments (12)

AlecAivazis avatar AlecAivazis commented on June 20, 2024 1

Alright I think we're in business now. I was able to reproduce your issue in insomnia. There was an error when pulling in the locations for directives. It should be fixed now in v0.0.8. Sorry for the inconvenience!

from graphql.

AlecAivazis avatar AlecAivazis commented on June 20, 2024

Hey @danielvladco! Thanks for opening this. I think this issue belongs in the nautilus/graphql package. I'll move it over there for you.

I have some time to investigate this today so hopefully I'll have something for you soon

from graphql.

AlecAivazis avatar AlecAivazis commented on June 20, 2024

Okay so I've tried to see if I can reproduce your problem and I think I need a bit more information.

I ran the following code in a script and was able to find the fields for an input type:

// introspect the apis
schemas, err := graphql.IntrospectRemoteSchemas(
	"https://api.graphql.jobs/",
)
if err != nil {
	panic(err)
}

fmt.Println(schemas[0].Schema.Types["TagWhereInput"].Fields)

Is the payload you posted above a response from introspecting the gateway? Or is that the introspection query to one of the backend services?

from graphql.

danielvladco avatar danielvladco commented on June 20, 2024

Hi @AlecAivazis ,
Thanks for quick reply,

run this piece of code:

schemas, err := graphql.IntrospectRemoteSchemas(
	"https://api.graphql.jobs/",
)
if err != nil {
	panic(err)
}

, _ := json.Marshal(schemas[0].Schema.Types["TagWhereInput"])
fmt.Printf("%s/n", string(b))

notice how Kind field for input type is empty, when it's expected to be INPUT_OBJECT
also there are Fields but for some reason all their fields are resolved to zero values except for field Name and Type

You can introspect the endpoint directly and see all the mismatching fields.

from graphql.

AlecAivazis avatar AlecAivazis commented on June 20, 2024

Ah yea I noticed a similar inconsistency today while digging through this. I'll try to have a fix for you very soon. Sorry about this!

from graphql.

AlecAivazis avatar AlecAivazis commented on June 20, 2024

Okay i just pushed a fix that assigns the right Kind to input objects. I tested the script again and am able to interact with the API through the playground provided by the gateway.

Looking at the introspection query used in the gateway (the same used by most libraries) we only ask for name, description, defaultValue, and type information on input objects. Is something missing that you usually see with other introspections?

from graphql.

AlecAivazis avatar AlecAivazis commented on June 20, 2024

@danielvladco are you still seeing issues?

from graphql.

danielvladco avatar danielvladco commented on June 20, 2024

@AlecAivazis Unfortunately yes,

I use Insomnia as my graphql client and when it's trying to do introspection query I receive this error:
image

however when I use direct link It works fine

from graphql.

AlecAivazis avatar AlecAivazis commented on June 20, 2024

Okay that’s progress! Looks like insomnia is expecting a directive to be defined that isn’t. I’ll go download it and give it a try

from graphql.

danielvladco avatar danielvladco commented on June 20, 2024

Thanks, It seems to work now

You forgot a print here https://github.com/nautilus/graphql/blob/master/introspection.go#L196
:)

from graphql.

AlecAivazis avatar AlecAivazis commented on June 20, 2024

Whoops! Thanks for catching that. It should be gone now 😄

from graphql.

sbilello avatar sbilello commented on June 20, 2024

@danielvladco @AlecAivazis
In a real production ready example, there is no schema registry involved with nautilus?
"http://localhost:3004/query",
"http://localhost:3002/query",
"http://localhost:3006/query",
How do you dynamically update the service list?

from graphql.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.