Zaid-Ajaj / Snowflaqe

A dotnet CLI to generate type-safe GraphQL clients for F# and Fable with automatic deserialization, static query verification and type checking
MIT License
157 stars 26 forks source link

Errors on --generate (I have no \projects or \repo\Azure directories) #27

Closed houstonhaynes closed 3 years ago

houstonhaynes commented 3 years ago

My repo is in C:\repo. I don't have a C:\repo\Azure path. I also don't have a C:\projects path. Should I be rebuilding Snowflaqe from source so that it has the right dependency paths?

`PS C:\repo\GitHubGraphQL> snowflaqe --generate

 _____                      __ _
/  ___|                    / _| |
\ `--. _ __   _____      _| |_| | __ _  __ _  ___
 `--. \ '_ \ / _ \ \ /\ / /  _| |/ _` |/ _` |/ _ \
/\__/ / | | | (_) \ V  V /| | | | (_| | (_| |  __/
\____/|_| |_|\___/ \_/\_/ |_| |_|\__,_|\__, |\___|
                                          | |
                                          |_|

❤️  Open source https://www.github.com/Zaid-Ajaj/Snowflaqe
⚖️  MIT LICENSE

⏳ Loading GraphQL schema from ./schema.docs2.json Unhandled exception. System.UnauthorizedAccessException: Access to the path 'c:\repo\Azure\CosmosDB\azure-cosmos-db-graph-gremlindotnet-getting-started.git\objects\pack\pack-c96e57ccb981e79d47f974f04a19c0b27d2911de.idx' is denied. at System.IO.FileSystem.DeleteFile(String fullPath) at System.IO.File.Delete(String path) at Program.deleteFilesAndFolders(String directory, Boolean isRoot) in C:\projects\Snowflaqe\src\Program.fs:line 219 at Program.deleteFilesAndFolders(String directory, Boolean isRoot) in C:\projects\Snowflaqe\src\Program.fs:line 222 at Program.deleteFilesAndFolders(String directory, Boolean isRoot) in C:\projects\Snowflaqe\src\Program.fs:line 222 at Program.deleteFilesAndFolders(String directory, Boolean isRoot) in C:\projects\Snowflaqe\src\Program.fs:line 222 at Program.deleteFilesAndFolders(String directory, Boolean isRoot) in C:\projects\Snowflaqe\src\Program.fs:line 222 at Program.deleteFilesAndFolders(String directory, Boolean isRoot) in C:\projects\Snowflaqe\src\Program.fs:line 222 at Program.deleteFilesAndFolders(String directory, Boolean isRoot) in C:\projects\Snowflaqe\src\Program.fs:line 222 at Program.generate(String configFile) in C:\projects\Snowflaqe\src\Program.fs:line 280 at Program.main(String[] argv) in C:\projects\Snowflaqe\src\Program.fs:line 435 PS C:\repo\GitHubGraphQL>`

houstonhaynes commented 3 years ago

My snowflaqe.json

{ "schema": "./schema.docs2.json", "queries": "./queries", "project": "GitHubGQL", "output": "c:/repo/", "target": "fsharp" }

Zaid-Ajaj commented 3 years ago

When you generate the code into a directory, Snowflaqe cleans the directory if it is not empty. So you basically tried to delete c:/repo/ and everything inside. I suggest you use an empty directory relative to the project you are working on:

{ 
  "schema": "./schema.docs2.json", 
  "queries": "./queries", 
  "project": "GitHubGQL", 
  "output": "./output",  <-- see here
  "target": "fsharp"
 }
houstonhaynes commented 3 years ago

oh yeah that would have been bad (though most things are sync'd up) 😁😲🎭