Initialize the code generation configuration Help

Hello,

I’m extremely new to all of this. I’m trying to setup Apollo in a Swift project. I’m following along with the “getting started” but I’m not sure what to do with the Initialize the code generation configuration. I installed CLI… I think that worked. The next step is:

./apollo-ios-cli init --schema-name ${MySchemaName} --module-type ${ModuleType}

I’m not exactly sure what to do here. I’ve tried running this a few times, but get “missing value for schema name” or “bad substitution.” Any help is appreciated!

Hi @MrKearns - the surrounding ${ } are meant to convey that those are values you need to provide and that they’re specific to your project.

  • $(MySchemaName} should be the name of the schema or target, depending on what value you use for the module type.
  • ${ModuleType} specifies the type of module that you want to use for the schema types. Possible options are listed here.

So as a complete example here is a CLI init command where I am choosing to have the schema types configured as a Swift package named “GraphQLAPI” - ./apollo-ios-cli init --schema-name GraphQLAPI --module-type swiftPackageManager.

1 Like