Skip to content

Commit

Permalink
refactor: update schema
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgoff committed Aug 29, 2024
1 parent 5a7b7a2 commit d56b9f4
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 60 deletions.
10 changes: 5 additions & 5 deletions components/content-blocks/Reference/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { FragmentType, graphql, useFragment } from "@/gql/public-schema";
import Buttonish from "@rubin-epo/epo-react-lib/Buttonish";

const Fragment = graphql(`
fragment ReferenceBlock on contentBlocks_referenceModalBlock_BlockType {
referenceModalEntries {
fragment ReferenceBlock on contentBlocks_referenceBlock_BlockType {
referenceEntries {
... on referenceContent_default_Entry {
title
uri
Expand All @@ -19,14 +19,14 @@ const Fragment = graphql(`
const ReferenceWindowContentBlock: FunctionComponent<
BaseContentBlockProps<FragmentType<typeof Fragment>>
> = (props) => {
const { referenceModalEntries } = useFragment(Fragment, props.data);
const { referenceEntries } = useFragment(Fragment, props.data);
const popupWindow = useRef<WindowProxy | null>(null);

if (referenceModalEntries[0] === null) {
if (referenceEntries[0] === null) {
return null;
}

const { uri, title, slug } = referenceModalEntries[0];
const { uri, title, slug } = referenceEntries[0];

const url = `/${uri}`;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const blockMap: Record<
contentBlocks_filterTool_BlockType: Blocks.FilterTool,
contentBlocks_cameraFilterTool_BlockType: Blocks.CameraFilterTool,
contentBlocks_table_BlockType: Blocks.Table,
contentBlocks_referenceModalBlock_BlockType: Blocks.Reference,
contentBlocks_referenceBlock_BlockType: Blocks.Reference,
contentBlocks_colorFilterToolBlock_BlockType: Blocks.ColorFilterTool,
contentBlocks_equation_BlockType: Blocks.Equation,
contentBlocks_video_BlockType: Blocks.Video,
Expand Down
12 changes: 6 additions & 6 deletions gql/educator-schema/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4596,7 +4596,7 @@ export type ColorFilterToolObjects_Object_BlockType_CountArgs = {
field: Scalars['String']['input'];
};

export type ContentBlocks_NeoField = ContentBlocks_BarGraphTool_BlockType | ContentBlocks_CameraFilterTool_BlockType | ContentBlocks_ColLeft_BlockType | ContentBlocks_ColRight_BlockType | ContentBlocks_ColorFilterToolBlock_BlockType | ContentBlocks_Equation_BlockType | ContentBlocks_FilterTool_BlockType | ContentBlocks_Group_BlockType | ContentBlocks_Image_BlockType | ContentBlocks_MagnitudeScatterPlot_BlockType | ContentBlocks_QuestionBlock_BlockType | ContentBlocks_ReferenceModalBlock_BlockType | ContentBlocks_ScatterplotTool_BlockType | ContentBlocks_SupernovaDistanceDistribution_BlockType | ContentBlocks_Table_BlockType | ContentBlocks_Text_BlockType | ContentBlocks_TwoColumnContainer_BlockType | ContentBlocks_Video_BlockType;
export type ContentBlocks_NeoField = ContentBlocks_BarGraphTool_BlockType | ContentBlocks_CameraFilterTool_BlockType | ContentBlocks_ColLeft_BlockType | ContentBlocks_ColRight_BlockType | ContentBlocks_ColorFilterToolBlock_BlockType | ContentBlocks_Equation_BlockType | ContentBlocks_FilterTool_BlockType | ContentBlocks_Group_BlockType | ContentBlocks_Image_BlockType | ContentBlocks_MagnitudeScatterPlot_BlockType | ContentBlocks_QuestionBlock_BlockType | ContentBlocks_ReferenceBlock_BlockType | ContentBlocks_ScatterplotTool_BlockType | ContentBlocks_SupernovaDistanceDistribution_BlockType | ContentBlocks_Table_BlockType | ContentBlocks_Text_BlockType | ContentBlocks_TwoColumnContainer_BlockType | ContentBlocks_Video_BlockType;

export type ContentBlocks_BarGraphTool_BlockType = ElementInterface & NeoBlockInterface & {
__typename?: 'contentBlocks_barGraphTool_BlockType';
Expand Down Expand Up @@ -5558,8 +5558,8 @@ export type ContentBlocks_QuestionBlock_BlockTypeQuestionEntriesArgs = {
yAxisMin?: InputMaybe<Array<InputMaybe<Scalars['QueryArgument']['input']>>>;
};

export type ContentBlocks_ReferenceModalBlock_BlockType = ElementInterface & NeoBlockInterface & {
__typename?: 'contentBlocks_referenceModalBlock_BlockType';
export type ContentBlocks_ReferenceBlock_BlockType = ElementInterface & NeoBlockInterface & {
__typename?: 'contentBlocks_referenceBlock_BlockType';
/** Return a number of related elements for a field. */
_count?: Maybe<Scalars['Int']['output']>;
/** Whether the element is archived. */
Expand All @@ -5580,7 +5580,7 @@ export type ContentBlocks_ReferenceModalBlock_BlockType = ElementInterface & Neo
level?: Maybe<Scalars['Int']['output']>;
/** The ID of the primary owner of the Neo block. */
primaryOwnerId?: Maybe<Scalars['Int']['output']>;
referenceModalEntries: Array<Maybe<EntryInterface>>;
referenceEntries: Array<Maybe<EntryInterface>>;
/** The element’s search score, if the `search` parameter was used when querying for the element. */
searchScore?: Maybe<Scalars['Int']['output']>;
/** The handle of the site the element is associated with. */
Expand Down Expand Up @@ -5610,12 +5610,12 @@ export type ContentBlocks_ReferenceModalBlock_BlockType = ElementInterface & Neo
};


export type ContentBlocks_ReferenceModalBlock_BlockType_CountArgs = {
export type ContentBlocks_ReferenceBlock_BlockType_CountArgs = {
field: Scalars['String']['input'];
};


export type ContentBlocks_ReferenceModalBlock_BlockTypeReferenceModalEntriesArgs = {
export type ContentBlocks_ReferenceBlock_BlockTypeReferenceEntriesArgs = {
after?: InputMaybe<Scalars['String']['input']>;
ancestorDist?: InputMaybe<Scalars['Int']['input']>;
ancestorOf?: InputMaybe<Scalars['Int']['input']>;
Expand Down
4 changes: 2 additions & 2 deletions gql/public-schema/gql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const documents = {
"\n fragment InvestigationGridBlock on homepageContentBlocks_investigationGrid_BlockType {\n heading: contentHeading\n investigations: investigationEntries {\n ... on investigations_investigationParent_Entry {\n id\n title\n rawImage: image {\n url {\n directUrlPreview\n directUrlOriginal\n PNG\n HighJPG\n LowJPG\n }\n width\n height\n metadata: additional {\n AltTextEN\n AltTextES\n CaptionEN\n CaptionES\n Credit\n }\n }\n url\n }\n }\n }\n": types.InvestigationGridBlockFragmentDoc,
"\n fragment MagnitudeScatterPlotBlock on contentBlocks_magnitudeScatterPlot_BlockType {\n lightCurveTool {\n ... on widgets_lightCurveTool_Entry {\n displayName\n dataset {\n ... on datasets_supernovaGalaxyObservations_Entry {\n title\n peakMjd: mjd\n json {\n ... on datasets_Asset {\n url\n }\n }\n }\n }\n yMin: yAxisMin\n yMax: yAxisMax\n }\n }\n }\n": types.MagnitudeScatterPlotBlockFragmentDoc,
"\n fragment QuestionsBlock on contentBlocks_questionBlock_BlockType {\n __typename\n id\n questionEntries {\n ...QuestionEntry\n }\n }\n": types.QuestionsBlockFragmentDoc,
"\n fragment ReferenceBlock on contentBlocks_referenceModalBlock_BlockType {\n referenceModalEntries {\n ... on referenceContent_default_Entry {\n title\n uri\n slug\n }\n }\n }\n": types.ReferenceBlockFragmentDoc,
"\n fragment ReferenceBlock on contentBlocks_referenceBlock_BlockType {\n referenceEntries {\n ... on referenceContent_default_Entry {\n title\n uri\n slug\n }\n }\n }\n": types.ReferenceBlockFragmentDoc,
"\n fragment SupernovaDistanceDistributionBlock on contentBlocks_supernovaDistanceDistribution_BlockType {\n instructions: widgetInstructions\n imageAlbum {\n url {\n directUrlPreview\n directUrlOriginal\n }\n width\n height\n name\n }\n json {\n ... on datasets_Asset {\n url\n }\n }\n step: binSize\n ...LightCurveQuestionData\n }\n": types.SupernovaDistanceDistributionBlockFragmentDoc,
"\n fragment TableBlock on contentBlocks_table_BlockType {\n id\n caption\n contentHeading\n header: tableHeader {\n ... on tableHeader_BlockType {\n headerRow {\n ... on headerRow_tableCell_BlockType {\n id\n text\n equation\n }\n }\n }\n }\n rows: displayTable {\n ... on displayTable_BlockType {\n cells: tableRow {\n ... on tableRow_tableCell_BlockType {\n id\n text: cellContent\n equation\n }\n ... on tableRow_rowHeader_BlockType {\n id\n text\n equation\n }\n ... on tableRow_previousQuestion_BlockType {\n question {\n ... on questions_default_Entry {\n id\n answerType\n rows: questionTable {\n ... on questionTable_BlockType {\n cells: tableCell {\n ... on tableCell_question_BlockType {\n id\n answerType: questionType\n options {\n ... on options_BlockType {\n label: optionLabel\n value: optionValue\n }\n }\n }\n ... on tableCell_static_BlockType {\n id\n equation\n text\n }\n ... on tableCell_rowHeader_BlockType {\n id\n equation\n text\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n": types.TableBlockFragmentDoc,
"\n fragment TextBlock on contentBlocks_text_BlockType {\n id\n text\n }\n": types.TextBlockFragmentDoc,
Expand Down Expand Up @@ -238,7 +238,7 @@ export function graphql(source: "\n fragment QuestionsBlock on contentBlocks_qu
/**
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
*/
export function graphql(source: "\n fragment ReferenceBlock on contentBlocks_referenceModalBlock_BlockType {\n referenceModalEntries {\n ... on referenceContent_default_Entry {\n title\n uri\n slug\n }\n }\n }\n"): (typeof documents)["\n fragment ReferenceBlock on contentBlocks_referenceModalBlock_BlockType {\n referenceModalEntries {\n ... on referenceContent_default_Entry {\n title\n uri\n slug\n }\n }\n }\n"];
export function graphql(source: "\n fragment ReferenceBlock on contentBlocks_referenceBlock_BlockType {\n referenceEntries {\n ... on referenceContent_default_Entry {\n title\n uri\n slug\n }\n }\n }\n"): (typeof documents)["\n fragment ReferenceBlock on contentBlocks_referenceBlock_BlockType {\n referenceEntries {\n ... on referenceContent_default_Entry {\n title\n uri\n slug\n }\n }\n }\n"];
/**
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
*/
Expand Down
Loading

0 comments on commit d56b9f4

Please sign in to comment.