Skip to content

building a apollo_encoder Document from apollo_parser Document #902

Closed
@yanns

Description

@yanns

We were using such code to build an apollo_encoder Document from an apollo_parser Document:

use apollo_parser::cst::Document;

fn derive_public_schema(doc: Document,...) {
    let mut pub_schema = apollo_encoder::Document::new();

    for definition in doc.definitions() {
        match definition {
            Definition::SchemaDefinition(e) => pub_schema.schema(e.try_into()?),
            Definition::OperationDefinition(e) => pub_schema.operation(e.try_into()?),
            Definition::FragmentDefinition(e) => pub_schema.fragment(e.try_into()?),
...

The update of apollo_parser to 0.8.x. breaks this code.
I could not find how to deal with that.
What would be the new way?

My goal is to transform the schema based on some custom directives and to compute its new SDL (as String)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions