apollographql / apollo-ios

📱  A strongly-typed, caching GraphQL client for iOS, written in Swift.
https://www.apollographql.com/docs/ios/
MIT License
3.89k stars 728 forks source link

Cannot find 'LaunchListQuery' in scope #3403

Closed conradwt closed 4 months ago

conradwt commented 4 months ago

Summary

In step 5 of Build a project with Apollo tutorial, I'm getting an error when I add the following code to the init() method:

Implement the query

    Network.shared.apollo.fetch(query: LaunchListQuery()) { result in
        switch result {
        case .success(let graphQLResult):
            print("Success! Result: \(graphQLResult)")
        case .failure(let error):
            print("Failure! Error: \(error)")
        }
    }

Errors:

Cannot find 'LaunchListQuery' in scope
Generic parameter 'Query' could not be inferred

Version

1.13.0

Steps to reproduce the behavior

  1. Complete Tutorial Steps 1 - 5

Logs

Logging Error: Failed to initialize logging system. Log messages may be missing. If this issue persists, try setting IDEPreferLogStreaming=YES in the active scheme actions environment variables.

Anything else?

I have tried with Xcode 15.4 on macOS 14.5 without success.

calvincestari commented 4 months ago

Hi @conradwt - have you made sure to add import RocketReserverAPI to that file? The queries are generated into a separate module so you'll need to explicitly import it before you can use it.

github-actions[bot] commented 4 months ago

Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo iOS usage and allow us to serve you better.