-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
accept multiple url variants for graphiql IDE #14084
Comments
Some tips on how to implement this: gatsby/packages/gatsby/src/commands/develop.js Lines 126 to 153 in 0b56576
to handle variants mentioned by Shannon in basic example. To do this we can update paths that our endpoint handle. Express server allow to use path patterns or regular expressions ( https://expressjs.com/en/api.html#path-examples ) and I think those will work here very nicely. It would be very nice (but not strictly needed) if there were also cypress tests for this in https://github.com/gatsbyjs/gatsby/tree/master/e2e-tests/development-runtime/cypress/integration to make sure that visiting those paths result in viewing graphiql interface |
@pieh Can I pick this one? |
@pieh I have a small question regarding code structuring. I changed the endpoints so they use the express patterns to match everything with at least 1 underscore and match both on But now I would be interested in creating cypress tests for this as well, where I test whether the patterns give the graphqlIDE, but I don't really see where the best spot would be to put these tests. Should this be a file like |
Ah, sorry I didn't reply, but I see you managed. The place for e2e tests is not clear, but one you picked seems very reasonable here |
Summary
In usability tests, we discovered that when people type the wrong thing in the browser (e.g. “localhost:8000/_ _ graphiql), we could either redirect to "correct" one or just support multiple different cases. This will help them spend less time looking for the right link.
Basic example
I'm not sure what the best practice is here. Here are some ideas:
Support various number of underscores before graphiql e.g. _graphiql (1 underscore), __graphiql (2 underscores), ___graphiql (3 underscores), ____graphiql (4 underscores)
Support "graphql" and "graphiql"
Other ideas?
Motivation
We observed that many users (including ourselves!) say "how many underscores is this again? I can never remember" and "I always misspell Graphiql. How do you even say Graphiql??" haha.
The text was updated successfully, but these errors were encountered: