Skip to content

Get the query's name (string) for usage in Apollo's refetchQueries #83

@elnygren

Description

@elnygren

Could graphql_ppx generate a let binding that contains the GraphQL query's name?

example input

module FooBarGQL = [%graphql
  {|
  query fooBarDingDong {
    foo { bar }
  }
|}
];

output:

module FooBarGQL = {
  /* all the usual fields  generated by graphql_ppx */
  let ppx_printed_query = "...";
  let query = ppx_printed_query;
  let parse = value...;
  // ...etc...

  /* new field */
  let queryName = "fooBarDingDong"
}

This would be nice as now we have to do refetchQueries=[| "fooBarDingDong" |] https://github.com/apollographql/reason-apollo#mutation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions