Nick
03/23/2022, 1:47 PMquery Project($id: ID!) {
project(projectId: $id) {
id
name
}
}
And I’m calling it with the following:
val project = apollo.query(ProjectQuery(projectId)).execute()
What would cause this issue in the screenshot where it says I’m missing a field and some other errors?mbonnin
03/23/2022, 1:50 PMmbonnin
03/23/2022, 1:50 PMNick
03/23/2022, 1:50 PMmbonnin
03/23/2022, 1:51 PMmbonnin
03/23/2022, 1:52 PMNick
03/23/2022, 1:52 PMmbonnin
03/23/2022, 1:52 PM./gradlew convertApolloSchema --to --from
)Nick
03/23/2022, 1:54 PMgraphqls
, thats what we want right?mbonnin
03/23/2022, 1:54 PMNick
03/23/2022, 1:54 PMtype Project {
id: ID!
name: String!
annotations(filter: AnnotationFilter): [Annotation!]!
annotationsCount: Int!
}
mbonnin
03/23/2022, 1:54 PMQuery
typeNick
03/23/2022, 1:54 PMproject(projectId: ID!): Project
Nick
03/23/2022, 1:55 PMprojectId
→ id
?mbonnin
03/23/2022, 1:55 PMproject(id: ID!): Project
Nick
03/23/2022, 1:57 PMNick
03/23/2022, 1:57 PMNick
03/23/2022, 1:58 PMmbonnin
03/23/2022, 1:59 PMNick
03/23/2022, 1:59 PMmbonnin
03/23/2022, 1:59 PMNick
03/23/2022, 1:59 PMmbonnin
03/23/2022, 1:59 PMmbonnin
03/23/2022, 2:00 PMNick
03/23/2022, 2:00 PMNick
03/23/2022, 2:00 PMmbonnin
03/23/2022, 2:00 PMNick
03/23/2022, 2:00 PMNick
03/23/2022, 2:01 PMmbonnin
03/23/2022, 2:01 PMNick
03/23/2022, 2:01 PMmbonnin
03/23/2022, 2:01 PMmbonnin
03/23/2022, 2:01 PMNick
03/23/2022, 3:17 PMprojectId
instead of id
. they think I might be hitting the wrong endpoint?Nick
03/23/2022, 3:17 PMapollo {
service("[redacted]") {
srcDir("src/main/graphql/[redacted]")
generateOptionalOperationVariables.set(false)
generateApolloMetadata.set(true)
generateKotlinModels.set(true)
packageName.set("com.[redacted].apollo")
// this will create a download[redacted]ApolloSchemaFromIntrospection task
introspection {
endpointUrl.set("[redacted]")
schemaFile.set(file("src/main/graphql/[redacted]/schema.graphqls"))
}
}
service("SmartTrack") {
srcDir("src/main/graphql/smarttrack")
generateOptionalOperationVariables.set(false)
generateApolloMetadata.set(true)
generateKotlinModels.set(true)
packageName.set("com.smarttrack.apollo")
mapScalar("DateTimeUtc", "java.util.Date", "com.apollographql.apollo3.adapter.DateAdapter")
// this will create a downloadSmartTrackApolloSchemaFromIntrospection task
introspection {
headers.set("X-Admin-Token": "[redacted]")
endpointUrl.set("[redacted]")
schemaFile.set(file("src/main/graphql/smarttrack/schema.graphqls"))
}
}
}
mbonnin
03/23/2022, 3:18 PMmbonnin
03/23/2022, 3:19 PMmbonnin
03/23/2022, 3:19 PMprojectId
is correct and you get introspection correctly then it means your runtime code is maybe hitting a different endpoint?Nick
03/23/2022, 3:21 PMNick
03/23/2022, 3:23 PMNick
03/23/2022, 3:24 PMNick
03/23/2022, 3:24 PMNick
03/23/2022, 3:24 PMmbonnin
03/23/2022, 3:24 PMmbonnin
03/23/2022, 3:26 PMEndpoint1ApolloClient
for an example and it adds some coupling between codegen and the runtime so we decided not to.mbonnin
03/23/2022, 3:26 PM