Skip to content

Configure the Resolve Function

Compare
Choose a tag to compare
@jeffreybaird jeffreybaird released this 20 Apr 17:44
7ef0ff9

When defining a Federated schema, you can now set the resolve function in the initializer.

new FederatedSchema([
    'query'    => $this->queryType,
    'mutation' => $this->mutationType,
    'types' => $this->typeRegistry->getAll(),
    'resolve' => function ($root, $args, $context, $info) {
        $adapter = new SyncPromiseAdapter();
        $resolver = new FederatedSchemaResolver($root, $args, $context, $info, $adapter);
        return $resolver->resolve();
    }
]);