graphiql icon indicating copy to clipboard operation
graphiql copied to clipboard

[reference] renderGraphiql Package

Open iFlameing opened this issue 5 years ago • 21 comments

Fixes #1117. This will help the CDN users to easily implement graphiql IDE without using any build tools like Webpack. They can perform all the actions they will intend to do without build tools.

iFlameing avatar Mar 07 '20 11:03 iFlameing

@acao I moved the functions in a separate module. can you take a look at it, please!!!!

iFlameing avatar Mar 11 '20 10:03 iFlameing

@iFlameing looking better, now lets expose the options for generating the fetcher in my example i linked to. lets port over that logic and the typescript definitions

acao avatar Mar 11 '20 18:03 acao

@iFlameing like this: https://github.com/graphql/graphiql/blob/94d64b19f5fd4534a7ee0aa0d1f56b980a94401b/packages/graphiql/src/renderGraphiQL.js#L12

acao avatar Mar 11 '20 18:03 acao

@acao I provided the options for generating the fetcher and also added typescript. Please! take a look!!

iFlameing avatar Mar 12 '20 21:03 iFlameing

@iFlameing looking excellent! I’ll take a closer look tonight. Do you want to create a render-graphiql-example as well? also lets make sure directory names are lower case, for better linux support

acao avatar Mar 12 '20 21:03 acao

@acao Yes! I want to create an example. Can you give me some starter points regarding how I can use it in an example?

iFlameing avatar Mar 13 '20 14:03 iFlameing

@acao I have created a simple example in javascript https://github.com/iFlameing/graphiqlCDN. I don't know how I can build this package so that I can use it in the HTML file.

It is totally the same as this package only it doesn't contains typescript parts.

iFlameing avatar Mar 13 '20 15:03 iFlameing

@iFlameing my bad, i meant like in the /examples repository, so the example would be in this PR.

please just re-create from the webpack example, and use the encapsulation function instead

thanks for all your help on this, its looking great!

acao avatar Mar 13 '20 20:03 acao

@iFlameing hey so, lets get this one revived! I think it's close, can you remove the package-lock.json? I'll see if i can fix the typescript issue you were having

acao avatar Apr 14 '20 22:04 acao

@iFlameing can you give me permission to commit to this PR?

acao avatar Apr 14 '20 22:04 acao

@acao I am happy to do any help :) You can commit to this PR. If you need any help please ping me here or in discord :)

iFlameing avatar Apr 14 '20 22:04 iFlameing

@acao wait a sec I will do a commit for removing package-lock.json :)

iFlameing avatar Apr 14 '20 22:04 iFlameing

It looks like there are still some package-lock.json files if you can clean those up!

acao avatar May 03 '20 19:05 acao

@acao I have removed the package-lock.json :)

iFlameing avatar May 03 '20 20:05 iFlameing

Nice! i've been working on it for a few hours, and I almost have the typescript working, and the type interfaces defined. there was a lot missing, because there was no tsconfig.json, the typescript was not working for the package at all - in vscode, etc. many of the functions didn't work at all, so I might add some basic unit tests as well?

acao avatar May 04 '20 01:05 acao

so, theres just still a lot of work that needs to be done to get this ready, still working through linting issues (this is why the CI build is failing), and i've stashed my work and will come back!

acao avatar May 04 '20 18:05 acao

what is missing from this one? I'd like to use the latest GraphiQL in my Koa app

sibelius avatar Jun 08 '20 22:06 sibelius

@sibelius a lot of things, i spent a lot of time just trying to get it to pass the linter or compile.

most importantly, it has a major security vulnerability that we just fixed in playground

we just need to re-do this entire PR

acao avatar Jun 09 '20 16:06 acao

@acao can you push your changes so that I can take a look and learn the things which I am missing in this PR

iFlameing avatar Jun 11 '20 09:06 iFlameing

@iFlameing first you will need to fix the original linting failures. you can see the list of fixes you need to make when you use a linter.

there are many more considerations but we will be going in a different direction

acao avatar Jun 11 '20 14:06 acao

@sibelius if you're interested in helping to get this where it needs to be, let's start with opening a PR to fix the linting failures. @iFlameing you are also welcome to fix the linting errors here so we can move forward on this PR

then, let's evaluate the best method to do this. the playground middlewares suggest one route, but we have other options. express-graphql has a nice approach as well. let's make sure whatever route we choose works offline instead of relying on CDN urls, as well

acao avatar Jun 29 '20 15:06 acao