You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello!! I am trying to convert one of my object types to an entity, but when I pushed the subgraph to my federated graph, the type didn't show up with the @key directive, so I got a composition error when I tried to push the schema for the other subgraph where I want to reference this type.
Then, I tried outputting the schema locally with File.write("schema.graphql", Schema.federation_sdl), and the result was the same -- directive not included.
require'apollo-federation'classSchema < GraphQL::SchemaincludeApolloFederation::SchemamutationGraph::MutationTypequeryGraph::QueryTypedefself.resolve_type(abstract_type,object,context)raise"You need to define resolve_type in #{abstract_type}"enduseGraphQL::Execution::ExecuteuseGraphQL::Analysisend
I tried putting a debugger in ApolloFederation::HasDirectives#add_directive, and that seems to be getting hit with the correct key that needs to be added, so I'm puzzled as to why it doesn't end up in the SDL output.
For reference, I am using apollo-federation 3.8.3 and graphql 1.12.24
The text was updated successfully, but these errors were encountered:
Update: I think I may have found the root cause. As shown above, my schema is still using the old GraphQL runtime, instead of the new
use GraphQL::Execution::Interpreter
use GraphQL::Analysis::AST
runtime that is the default as of graphql 1.12.x.
It also seems that as of apollo-federation 2.2.1, the new runtime is the only one that is supported (referencing #177). I previously tried to update my software to use the new runtime, but I got a bunch of unit test failures when I did that. It seems like something changed with the way the library interprets field names in snake_case vs camelCase, and it wasn't clear to me what changes I needed to make to migrate to the new runtime.
Hello!! I am trying to convert one of my object types to an entity, but when I pushed the subgraph to my federated graph, the type didn't show up with the
@key
directive, so I got a composition error when I tried to push the schema for the other subgraph where I want to reference this type.Then, I tried outputting the schema locally with
File.write("schema.graphql", Schema.federation_sdl)
, and the result was the same -- directive not included.Then, I have my BaseObject defined like so:
BaseField
Schema
I tried putting a debugger in
ApolloFederation::HasDirectives#add_directive
, and that seems to be getting hit with the correct key that needs to be added, so I'm puzzled as to why it doesn't end up in the SDL output.For reference, I am using apollo-federation 3.8.3 and graphql 1.12.24
The text was updated successfully, but these errors were encountered: