Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure graphql path #15

Merged
merged 1 commit into from
Aug 20, 2018
Merged

Conversation

poulad
Copy link
Contributor

@poulad poulad commented Feb 19, 2018

Following #6

This is not the best approach but easiest for clients to use.

Here is what happens if GraphQL url is not the default (as set in index.html):

  • Create a temp dir /tmp/graphiql-dotnet/graphql-path.js
  • Write var graphqlPath='/api/graphql';
  • Serve it as file
  • index.html loads the file and path is set

@josephwoodward
Copy link
Owner

Oh awesome, thanks for this.

I'm wondering if it's worth seeing if we can avoid writing to disk bypass any drive permissions issues etc. I wonder how feasible it would be to make it an in memory JS files (given the size of it too)?

@poulad
Copy link
Contributor Author

poulad commented Feb 20, 2018

I'll see if I can implement IFileProvider for that.

@josephwoodward
Copy link
Owner

Thinking more about the benefits of storing it in memory over on disk is if someone removed the library, the files go with it (instead of leaving temp files on disk).

One way to do it would be to register an HTTP endpoint (where the user defines the endpoint) as middleware that reads the js file from the file provider/assembly and returns it as a stream.

@OlegZee
Copy link

OlegZee commented Apr 25, 2018

This if vital PR, guys. I'd separate the issues.
@pouladpld, consider passing parameter via query parameter so that there's no need to update index.html and take care on caching the file.

@rickhopkins
Copy link

This would be a great fix to have in place.

@josephwoodward
Copy link
Owner

Keen to pick this one back up and get it sorted in the next couple of days.

@josephwoodward
Copy link
Owner

Almost finished on this, watch this space.

@josephwoodward
Copy link
Owner

Got an open PR for this (#23) with a few changes. Was keen not to write to disk so instead have a mapped path that returns the small JS file.

@josephwoodward josephwoodward merged commit 4b3189b into josephwoodward:master Aug 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants