How to use the apollo-env.mapValues function in apollo-env

To help you get started, we’ve selected a few apollo-env examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github apollographql / apollo-tooling / packages / apollo-graphql / src / schema / transformSchema.ts View on Github external
function replaceArgs(args: GraphQLFieldConfigArgumentMap) {
    return mapValues(args, arg => ({
      ...arg,
      type: replaceType(arg.type)
    }));
  }
}
github apollographql / apollo-tooling / packages / apollo-graphql / src / schema / transformSchema.ts View on Github external
function replaceInputFields(
    fieldsMap: GraphQLInputFieldConfigMap
  ): GraphQLInputFieldConfigMap {
    return mapValues(fieldsMap, field => ({
      ...field,
      type: replaceType(field.type)
    }));
  }
github apollographql / apollo-tooling / packages / apollo-graphql / src / schema / buildSchemaFromSDL.ts View on Github external
.flat();

    for (const { operation, type } of operationTypes) {
      operationTypeMap[operation] = type.name.value;
    }
  } else {
    operationTypeMap = {
      query: "Query",
      mutation: "Mutation",
      subscription: "Subscription"
    };
  }

  schema = new GraphQLSchema({
    ...schema.toConfig(),
    ...mapValues(operationTypeMap, typeName =>
      typeName
        ? (schema.getType(typeName) as GraphQLObjectType)
        : undefined
    )
  });

  for (const module of modules) {
    if (!module.resolvers) continue;
    addResolversToSchema(schema, module.resolvers);
  }

  return schema;
}
github apollographql / apollo-tooling / packages / apollo-graphql / src / schema / transformSchema.ts View on Github external
function replaceFields(
    fieldsMap: GraphQLFieldConfigMap
  ): GraphQLFieldConfigMap {
    return mapValues(fieldsMap, field => ({
      ...field,
      type: replaceType(field.type),
      args: field.args ? replaceArgs(field.args) : undefined
    }));
  }

apollo-env

MIT
Latest version published 3 years ago

Package Health Score

67 / 100
Full package analysis

Similar packages