graphprotocol / mutations

Apache License 2.0
4 stars 5 forks source link

Add @client To Query For User #3

Closed dOrgJelli closed 4 years ago

dOrgJelli commented 4 years ago

Instead of making the user add @client as a directive to their mutation queries, we should add it for them if we know we're using a locaResolverExecutor. I think we should add the @client directive like so:

mutationExecutors/localResolver.ts

const localResolver = (...) => {
  const definitions = Array.from(mutationQuery.query.definitions.values())
  // add the @client directive here
  const query: DocumentNode = {
    kind: mutationQuery.query.kind,
    loc: mutationQuery.query.loc,
    definitions: 
  }
  ...
}
Jannis commented 4 years ago

This is not what we should do. @client is entirely specific to Apollo and its withClientState. See this comment for what we (most likely) should do instead: https://github.com/graphprotocol/mutations/pull/1#issuecomment-585727131

dOrgJelli commented 4 years ago

Moved to: https://github.com/graphprotocol/mutations/issues/11