2

Let's say I have a field called featuredImage.

If I start typing "id," for example, it will show that as an available sub field using autocomplete.

But what if you don't know what the sub fields are?

{
  featuredImage {
    // What fields are available?
  }
}

How do you use GraphQL to show what sub fields are available?

AO Folts
  • 499
  • 1
  • 4
  • 12

1 Answers1

3

Try the keyboard shortcut by doing 'ctrl + space' and it should bring up all the options, similar in many text editors.

{ 
  featuredImage {
    /* ctrl + space */
    /* displays options */
  }
}
jkdowdle
  • 163
  • 2
  • 7
  • Sweet! I didn't know about that one. Thanks! – AO Folts Aug 29 '18 at 18:34
  • 1
    No Problem! Check it out also in your text editor. Doing something like - const myarray = [] myarray. /* ctrl + space */ and you will get those auto complete options of map, filter, push etc. This has been super helpful for me in graphiql, and typed npm packages. – jkdowdle Aug 29 '18 at 19:03