Introspection

GraphQL introspection can be used to explore the exposed EdgeDB types and expresssion aliases. Note that there are certain types like tuple that cannot be expressed in terms of the GraphQL type system (a tuple can be like a heterogeneous “List”).

Consider the following GraphQL introspection query:

  1. {
  2. __type(name: "Query") {
  3. name
  4. fields {
  5. name
  6. args {
  7. name
  8. type {
  9. kind
  10. name
  11. }
  12. }
  13. }
  14. }
  15. }

Produces:

  1. {
  2. "__type": {
  3. "name": "Query",
  4. "fields": [
  5. {
  6. "name": "Author",
  7. "args": [
  8. {
  9. "name": "id",
  10. "type": {
  11. "kind": "SCALAR",
  12. "name": "ID"
  13. }
  14. },
  15. {
  16. "name": "name",
  17. "type": {
  18. "kind": "SCALAR",
  19. "name": "String"
  20. }
  21. }
  22. ]
  23. },
  24. {
  25. "name": "Book",
  26. "args": [
  27. {
  28. "name": "id",
  29. "type": {
  30. "kind": "SCALAR",
  31. "name": "ID"
  32. }
  33. },
  34. {
  35. "name": "isbn",
  36. "type": {
  37. "kind": "SCALAR",
  38. "name": "String"
  39. }
  40. },
  41. {
  42. "name": "synopsis",
  43. "type": {
  44. "kind": "SCALAR",
  45. "name": "String"
  46. }
  47. },
  48. {
  49. "name": "title",
  50. "type": {
  51. "kind": "SCALAR",
  52. "name": "String"
  53. }
  54. }
  55. ]
  56. }
  57. ]
  58. }
  59. }

The above example shows what has been exposed for querying with GraphQL.