Skip to content
This repository has been archived by the owner on Oct 30, 2024. It is now read-only.

It can be hard to find references on options #432

Open
LinusU opened this issue Apr 18, 2023 · 0 comments
Open

It can be hard to find references on options #432

LinusU opened this issue Apr 18, 2023 · 0 comments

Comments

@LinusU
Copy link

LinusU commented Apr 18, 2023

Hello,

I had a slightly negative experience using your docs today, and my feeling is that this specific thing is somewhat recurring here. Specifically in this case I wanted to find the reference on what I can pass in as errorPolicy, and what the different modes does.

This is the part that I wanted to find:

Screenshot 2023-04-18 at 11 58 22

Unfortunately, searching for errorPolicy did not yield this result at all. Instead I get three other options:

Screenshot 2023-04-18 at 11 58 59

The first one is actually really close, but it takes me further down on the page, so I didn't realise that I could scroll up to find more information. It takes me to a quick explanation that one can set an errorPolicy to e.g. useQuery and than shows an example of using 'all'.

The second hit takes me to a page that again tells me that "If you set errorPolicy to all, useQuery does not discard query response data", but doesn't list all the available options. It ends with "For more information, see Handling operation errors", and a link to the top of the page of the first hit that explains about the different errors and error handling in general. I still did not realise that this page actually had a list of the available options.

The third hit looks really promising, it takes me straight to the heading options.errorPolicy and lists the three available values along with a description for each. Success! But wait... This page is actually called "HOC (deprecated)" and is not the list that I'm looking for, even though it seems that currently the valid options are the same.


My personal style of developing often leads me to just wanting to see references and definitions, whilst I fell that the Apollo docs are much more guide/examples oriented. This is probably a good thing, since I think that many people prefers it that way! It would be amazing if we could make some tweaks to improve the docs for people looking for references.

A suggestion that I have would be that if I search for an exact match of an option or function name, there would be some way to jump to the reference of that option/function. Maybe even a part of the documentation that focuses on just references and no examples.


Another example is searching for useQuery:

Screenshot 2023-04-18 at 12 10 33

The first hit is how to use TypeScript together with useQuery, and doesn't list or link to the available options that I can pass to useQuery.

The second hit takes me to a list of the options, I then scroll down a bit to errorPolicy:

Screenshot 2023-04-18 at 12 12 52

There is not a list of the available options here, so I click the "see GraphQL error policies" link:

Screenshot 2023-04-18 at 12 13 44

This starts of with an example of how the response from the server looks, and then finally when I scroll down I can find the valid options!


For a "reference first" person this is quite frustrating to navigate, and I would love if there is something we could to improve this situation! 🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant