-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4dd6c18
commit d30fbf4
Showing
14 changed files
with
93 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
/.dockerignore | ||
/.gitignore | ||
/docker-compose.yaml | ||
/justfile | ||
/Dockerfile | ||
/README.md | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
application: tendrel-graphql | ||
application: graphql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,7 @@ | |
biome | ||
bun | ||
just | ||
postgresql | ||
(stdenv.mkDerivation rec { | ||
pname = "copilot-cli"; | ||
version = "1.33.3"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,20 @@ | ||
import type { LocationResolvers } from "./../__generated__/types.generated"; | ||
import { sql } from "@/datasources/postgres"; | ||
import type { LocationResolvers, Name } from "@/schema"; | ||
export const Location: LocationResolvers = { | ||
/* Implement Location resolver logic here */ | ||
async name(parent, _, ctx) { | ||
const [name] = await sql<[Name]>` | ||
SELECT | ||
COALESCE(t.languagetranslationid, m.languagemasterid) AS id, | ||
COALESCE(t.languagetranslationtypeid, m.languagemastersourcelanguagetypeid) AS language_id, | ||
COALESCE(t.languagetranslationvalue, m.languagemastersource) AS value | ||
FROM public.languagemaster AS m | ||
LEFT JOIN public.languagetranslations AS t | ||
ON | ||
m.languagemasterid = t.languagetranslationmasterid | ||
AND t.languagetranslationtypeid = ${ctx.languageTypeId} | ||
WHERE m.languagemasterid = ${parent.name_id}; | ||
`; | ||
|
||
return name; | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,30 @@ | ||
import type { QueryResolvers } from "./../../__generated__/types.generated"; | ||
import { sql } from "@/datasources/postgres"; | ||
import type { Location } from "@/schema"; | ||
import type { QueryResolver } from "@/schema/resolvers"; | ||
import { GraphQLError } from "graphql"; | ||
|
||
export const locations: NonNullable<QueryResolvers['locations']> = async ( | ||
export const locations: QueryResolver<"locations"> = async ( | ||
_, | ||
{ customerId, options }, | ||
{ languageTypeId }, | ||
{ customerId }, | ||
{ authScope }, | ||
) => { | ||
return []; | ||
}; | ||
if (!authScope) { | ||
throw new GraphQLError("Unauthenticated", { | ||
extensions: { | ||
code: 401, | ||
}, | ||
}); | ||
} | ||
|
||
return await sql<Location[]>` | ||
SELECT | ||
l.locationuuid AS id, | ||
l.locationnameid AS name_id, | ||
l.locationparentid AS parent_id | ||
FROM public.location AS l | ||
INNER JOIN public.customer AS c | ||
ON l.locationcustomerid = c.customerid | ||
WHERE | ||
c.customeruuid = ${customerId}; | ||
`; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import type { TagResolvers } from "./../__generated__/types.generated"; | ||
import type { TagResolvers } from "@/schema"; | ||
|
||
export const Tag: TagResolvers = { | ||
/* Implement Tag resolver logic here */ | ||
}; |