Code Monkey home page Code Monkey logo

Comments (8)

leebyron avatar leebyron commented on May 6, 2024

Yeah, this seems useful, and probably is a bug. If GraphiQL is provided a new schema, that schema should take effect.

from graphiql.

syrusakbary avatar syrusakbary commented on May 6, 2024

Schema could be constructed by the fetcher if is not provided. Even with the fix if we change the fetcher and provide a null schema, it will not reconstruct a new one (as the construction is triggered in componentDidMount).
Moving the logic from componentDidMount to another method buildSchema? (which could be called also in componentWillReceiveProps) should solve this too :)

from graphiql.

leebyron avatar leebyron commented on May 6, 2024

Great point, the fetcher prop could also update. I just added another commit.

from graphiql.

BransonGitomeh avatar BransonGitomeh commented on May 6, 2024

Dynamically change schema - i'm thinking that this means that graphiQl is supposed to detect new changes in the server's schema once it changes . i always find myself needing to refresh graphiQl to detect new things or changes. I do it via the normal f5 browser refresh. how can i have graphiQl detect new changes . is there anything inbuilt, a refresh button maybe? or how should this be setup?

from graphiql.

leebyron avatar leebyron commented on May 6, 2024

You'll first need your server to be able to indicate when this has occurred via some subscribe hook. Check out packages like "watchify" to see how this is done in development environments. Then when your client is made aware that the server schema has changed, you'll need to write the code which refetches and produces a new schema instance to provide to . Thanks to this task, the graphiql view will automatically update.

from graphiql.

BransonGitomeh avatar BransonGitomeh commented on May 6, 2024

none of this is built in , ill have to write it all myself right? thanks

from graphiql.

leebyron avatar leebyron commented on May 6, 2024

Correct.

from graphiql.

BransonGitomeh avatar BransonGitomeh commented on May 6, 2024

OK thanks, ill attempt this and see how it goes

from graphiql.

Related Issues (20)

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.