Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Emily Gu
    @candysmurf
    One more question. Will the generated API in node.js?
    Emily Gu
    @candysmurf
    @here, I did a POC for Oasgraph and will recommend it to our team tomorrow. I like the way that it groups relationships into links. good job!
    Alan Cha
    @Alan-Cha
    Thank you very much @candysmurf! I think what we do with links sets us apart from similar projects
    Wojtek Trocki
    @wtrocki

    Hi Guys

    I absolutely love oasgraph library. Wanted to create quick issue (and follow up PR) but before that I want to make sure that my thoughts are ok

    Generally I see that oasgraph supports relationships by using links and I made that working.
    However I see that there is no support for caching
    what it means that there are duplicated queries for the same parameters when array is being used.
    do you think having DataLoader support as issue is good idea?
    Wojtek Trocki
    @wtrocki
    ok I found issue about this already: IBM/openapi-to-graphql#17
    Alan Cha
    @Alan-Cha
    @wtrocki Thank you so much for the compliments!
    Yeah, implementing some kind of caching option would be really cool... But so far, we haven't had the time to look into it... Even if there is time, we are focusing on more critical issues.
    Wojtek Trocki
    @wtrocki
    cool - I'm planning to use this in my own project and we definietly can contribute back
    Alan Cha
    @Alan-Cha
    That is why we implemented the customResolvers option as a compromise. At least with this option, users can implement their own custom caching.
    Wojtek Trocki
    @wtrocki
    trick is to just check with mantainers to see if they are interested in features before we invest time
    Alan Cha
    @Alan-Cha
    That would be fantastic!
    Wojtek Trocki
    @wtrocki
    currently I'm using oasgraph as schema generator
    Alan Cha
    @Alan-Cha
    Yes, this is definitely something we think would be useful
    I see! Glad to hear you are using our tool!
    Wojtek Trocki
    @wtrocki
    and then I'm using graphback generator to generate functional resolvers for database
    however oasgraph power is in mapping existing rest - so IMHO adding DataLoader will be the huge step to make it useful
    Alan Cha
    @Alan-Cha
    Are you using OASGraph or OpenAPI-to-GraphQL? I just want to make sure. We are trying to deprecate OASGraph in place of OtG. I also think it's a little bit weird how we're talking in the OASGraph lobby and not the OtG lobby but it's not an issue!
    Wojtek Trocki
    @wtrocki
    sorry I'm using OpenAPi-To-GraphQL as lib
    I was thinking that this was just old name of the same lib
    Alan Cha
    @Alan-Cha
    Yes, I definitely agree on providing some kind of caching option would definitely be useful!
    No problem! To be honest, I prefer the old name too :P
    Wojtek Trocki
    @wtrocki
    so the way I see it is that open-api-tographql (long name) is great at rest and graphback (another cli) is good at database
    making both roboust will make perfect tool for all the cases for community
    like single place where we can drop OpenAPi Definition or just graphql types (in form of schema) and get API wrapper or realtime datbase thing
    anyway.. I will create issue and work on PR
    ok that is all I needed to know
    thanks @Alan-Cha !
    Alan Cha
    @Alan-Cha
    Yep, that's why we open-sourced! We want to help promote GraphQL and contribute to the GraphQL ecosystem.
    No problem! Can't wait to see the PR!
    Wojtek Trocki
    @wtrocki
    I'm worreid that I did not explained myself clearly in IBM/openapi-to-graphql#240
    generally adding dataloaders can be done but it will be mostly by definiting some types manually on user side using the library
    I have replicated this use case by some slightly modified version of the library
    I'm just worried that making this change in core will introduce additional branch that will make maintenance more tricky
    so I went towards - hey let's let people to do makeExecutableSchema and come with their many use cases that core might not need to handle
    in fact the more I see current code the more I like it - it is clean and concise and doing what it should be doing so..
    still happy to do the changes, but do not want to drop something that will break things or degrate state of the entire library
    @Alan-Cha hope that is ok..
    I personally lean towards Apollo GraphQL as they have more robust execute method implementation
    Alan Cha
    @Alan-Cha
    To be honest, I don't have a great understanding of how dataloaders work. I know that @ErikWittern has some experience and he even used it for some demo for OtG. I think his main concerns are for how the requests should be cached (e.g. how long should they be stored). I will also ask him to join the conversation!
    For the time being, feel free to submit a PR with whatever you have, even if it is in a broken state, so that we can talk about it! :smile:
    Wojtek Trocki
    @wtrocki
    Perfect!
    Wojtek Trocki
    @wtrocki

    Hi @Alan-Cha @ErikWittern

    I have been experimenting with generators for the last 3 days.
    Generated Swagger definition based on existing node.js API server we have in our of our products and it generated OpenAPI definition.
    Then used OtG to generate GraphQL schema inside the express.js application.

    What I got is that now I can have dynamic GraphQL API based on the Restfull API.
    The entire experiment is kinda pointless in terms of real production usage because:

    • Generated resolver layer is calling rest endpoint instead of middleware behind it
    • There are some small things missing during translation so I needed to manually tweak both OpenAPI and GraphQL schema to make it functional
    This leads me to my final target which is generating OpenAPI definition from the GraphQL Schema and use openapi-generator
    my target is to use common service middleware to access data from API and Database so then it will not differ if someone exposes REST or GraphQL - they can do both
    curious if you guys are interested in the cases like above or they are outside the scope of the OtG
    Alan Cha
    @Alan-Cha
    @wtrocki Hey! Thanks for sharing again!
    Yeah, I can see how this is a common use case for our tool. Either using an existing OAS or generating one using a tool to create a GraphQL interface using OtG.