# Generated GraphQLQuery does not conform to protocol 'GraphQLOperation'

**URL:** <https://community.apollographql.com/t/generated-graphqlquery-does-not-conform-to-protocol-graphqloperation/6461>\
**Category:** Other Apollo Topics\
**Created:** [July 6, 2023, 4:55am UTC](https://community.apollographql.com/t/generated-graphqlquery-does-not-conform-to-protocol-graphqloperation/6461 "2023-07-06T04:55:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ADS](https://avatars.discourse-cdn.com/v4/letter/a/8e7dd6/32.png) [@ADS](https://community.apollographql.com/u/ADS)\
**Post date:** [July 6, 2023, 4:55am UTC](https://community.apollographql.com/t/generated-graphqlquery-does-not-conform-to-protocol-graphqloperation/6461/1 "2023-07-06T04:55:43Z")

</div>

Used apollo-ios-cli to generate Swift code from my graphql.  
When building via XCode 14.2, I get the following errors

=====

```auto
./graph-ql-trial/MySchema/Sources/Operations/Queries/MyQuery.graphql.swift:8:41: warning: 'DocumentType' is deprecated: renamed to 'OperationDocument'
  public static let document: ApolloAPI.DocumentType = .notPersisted(
                                        ^
./graph-ql-trial/MySchema/Sources/Operations/Queries/MyQuery.graphql.swift:8:41: note: use 'OperationDocument' instead
  public static let document: ApolloAPI.DocumentType = .notPersisted(
                                        ^ ~~~~~~~~~~~
                                        OperationDocument
./graph-ql-trial/MySchema/Sources/Operations/Queries/MyQuery.graphql.swift:6:14: error: type 'MyQuery' does not conform to protocol 'GraphQLOperation'
public class MyQuery: GraphQLQuery {
             ^
./graph-ql-trial/MySchema/Sources/Operations/Queries/MyQuery.graphql.swift:6:14: note: do you want to add protocol stubs?
public class MyQuery: GraphQLQuery {
             ^
./graph-ql-trial/MySchema/Sources/Operations/Queries/NagDashboardQuery.graphql.swift:8:41: warning: 'DocumentType' is deprecated: renamed to 'OperationDocument'
  public static let document: ApolloAPI.DocumentType = .notPersisted(
                                        ^
./graph-ql-trial/MySchema/Sources/Operations/Queries/NagDashboardQuery.graphql.swift:8:41: note: use 'OperationDocument' instead
  public static let document: ApolloAPI.DocumentType = .notPersisted(
                                        ^ ~~~~~~~~~~~
                                        OperationDocument
./graph-ql-trial/MySchema/Sources/Operations/Queries/NagDashboardQuery.graphql.swift:6:14: error: type 'NagDashboardQuery' does not conform to protocol 'GraphQLOperation'
public class NagDashboardQuery: GraphQLQuery {
             ^
./graph-ql-trial/MySchema/Sources/Operations/Queries/NagDashboardQuery.graphql.swift:6:14: note: do you want to add protocol stubs?
public class NagDashboardQuery: GraphQLQuery {

```

---

<div class="post-metadata">

**Author:** ![calvincestari](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/calvincestari/32/339_2.png) [@calvincestari](https://community.apollographql.com/u/calvincestari)\
**Post date:** [July 11, 2023, 12:49am UTC](https://community.apollographql.com/t/generated-graphqlquery-does-not-conform-to-protocol-graphqloperation/6461/2 "2023-07-11T00:49:53Z")

</div>

Hi @ADS, it looks like your version of the `apollo-ios` dependency might be out of sync with the generated code.

---

<div class="post-metadata">

**Author:** ![Justin\_Gonzalez](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/justin_gonzalez/32/5359_2.png) [@Justin\_Gonzalez](https://community.apollographql.com/u/Justin_Gonzalez)\
**Post date:** [February 6, 2025, 8:48pm UTC](https://community.apollographql.com/t/generated-graphqlquery-does-not-conform-to-protocol-graphqloperation/6461/3 "2025-02-06T20:48:42Z")

</div>


